Mark Shannon wrote:
class A: pass
class B(A): pass
class C(A,B):pass
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Cannot create a consistent method resolution
order (MRO) for bases B, A
All right, but this is okay:
class C(B, A): pass
> Michael Foord wrote:
>
For a super call in C, B is a sibling to A. For a super call in B, A
is a parent.
With the semantics I was suggesting if C calls super, but A doesn't
then B would still get called.
which is contradicted by:
"Siblings", in the context of a single MRO are thus classes between
which there is no sub-class/super-class relation.
So I maintain that the situation is far from clear. :-)
--
Greg
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com