MRO Error on Multiple Inheritance?

Fredrik Lundh fredrik at pythonware.com
Fri Jan 4 15:12:58 EST 2008


Ming wrote:


> TypeError: Error when calling the metaclass bases
>     Cannot create a consistent method resolution
> order (MRO) for bases A, B
> 
> (I submitted the problem to the author but I'm not sure I'll ever hear
> back.)  I'm guessing that this kind of diamond inheritance is
> prohibited by the interpreter, and that his lack of error messages
> from the interpretation is due to actually leaving out the "class
> B(A): pass"

or, alternatively, leaving out the (object) in the first class definition:

 >>> class A: pass
...
 >>> class B(A): pass
...
 >>> class D(A, B): pass
...
 >>>

</F>




More information about the Python-list mailing list