MRO Error on Multiple Inheritance?

Neil Cerutti mr.cerutti at gmail.com
Fri Jan 4 15:57:49 EST 2008


On Jan 4, 2008 3:03 PM, Ming <minger at gmail.com> wrote:

> I'm working through Wesley Chun's CPP2e and got this error on 13.11.1,
> pp 548 where his interpreter snippet shows no problems:
>
> ActivePython 2.5.1.1 (ActiveState Software Inc.) b
> Python 2.5.1 (r251:54863, May  1 2007, 17:47:05) [
> win32
> Type "help", "copyright", "credits" or "license" f
> >>> class A(object): pass
> ...
> >>> class B(A): pass
> ...
> >>> class C(B): pass
> ...
> >>> class D(A, B): pass
> ...
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> TypeError: Error when calling the metaclass bases
>    Cannot create a consistent method resolution
> order (MRO) for bases A, B


The mro of new-style classes changed between Python 2.2 and 2.3. Perhaps Mr.
Chun's code was written for 2.2.

See http://www.python.org/download/releases/2.3/mro/
-- 
Neil Cerutti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080104/fa05cb56/attachment-0001.html>


More information about the Python-list mailing list