multiple inheritance of a dynamic list of classes?

Neil Cerutti horpner at yahoo.com
Tue Feb 13 07:49:29 EST 2007


On 2007-02-13, Peter Otten <__peter__ at web.de> wrote:
> Well, what problems ocurring with
>
> class A: pass
> class B: pass
> class C(A, B): pass
>
> could be avoided by writing
>
> class A: pass
> class B(A): pass
> class C(B): pass
>
> instead? 

With multiple inheritance, the choice of algorithm for Method
Resolution Ordering isn't obvious or trivial. As I understand it,
Python got it wrong for quite some time, allowing "bad"
hierarchies to compile, i.e., classes for which the properties of
local precedence ordering and monotonicity did not hold.

URL:http://www.python.org/download/releases/2.3/mro/

-- 
Neil Cerutti



More information about the Python-list mailing list