On Wed, Jun 11, 2008 at 2:25 AM, simone <[EMAIL PROTECTED]> wrote:
> Christopher Spears ha scritto:

>> Traceback (most recent call last):
>>  File "<stdin>", line 1, in ?
>> TypeError: Error when calling the metaclass bases
>>    Cannot create a consistent method resolution
>> order (MRO) for bases B, A
>>
>> What does this error message mean?  The example worked in the book.  I
>> checked in the docs and could not find anything.
>
> http://www.python.org/download/releases/2.3/mro/

In layman's terms:
For class C, the method resolution order is C, B, A, object. Note that
B is before A. For class D, A would come before B because of the order
of declaration of base classes. This conflict causes the TypeError.

One way to fix it is to define D as
  class D(B, A):
    pass

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to