Here are some tweaks on both bits of code:
Paul McGuire wrote:
On May 25, 8:37 am, Michael Hines <[EMAIL PROTECTED]> wrote:
...
m = False
for b in bases :
if hasattr(b, '__mro__'):
for bb in b.__mro__ :
if bb == MetaHocObject.ho :
if m == True:
En Sun, 25 May 2008 13:32:39 -0300, Paul McGuire <[EMAIL PROTECTED]> escribió:
> Here's a more general version of your testing code, to detect *any*
> diamond multiple inheritance (using your sample classes).
>
> for cls in (A,B,C,D):
> seen = set()
> try:
> bases = cls.__bases__
>
Sorry I lost the original post.
Paul McGuire <[EMAIL PROTECTED]> writes:
> On May 25, 8:37 am, Michael Hines <[EMAIL PROTECTED]> wrote:
>> Thanks very much, Arnaud. That is exactly the hint I needed. Since it is
>> not multiple inheritance per se I prohibit but only multiple inheritance
>> invol
On May 25, 8:37 am, Michael Hines <[EMAIL PROTECTED]> wrote:
> Thanks very much, Arnaud. That is exactly the hint I needed. Since it is
> not multiple inheritance per se I prohibit but only multiple inheritance
> involving more than one HocObject class, I replaced your len(bases) > 1
> test with
>
Thanks very much, Arnaud. That is exactly the hint I needed. Since it is
not multiple inheritance per se I prohibit but only multiple inheritance
involving more than one HocObject class, I replaced your len(bases) > 1
test with
m = False
for b in bases :
if hasattr(b, '__mro__'):