[Ethan Furman]
> Speaking of new-style classes only, don't they all end in object?  And
> if the MRO is only known at run-time, how is one to know at code-time
> whether your (new-style) class is at the end of the line?

That is a bit of a PITA.  One way of handling it is to design your
diamond so that only one class inherits from object and that class
doesn't use super().   Or you can wrap the super call in a try/except
AttributeError.

Cooperative multiple inheritance isn't pretty -- which is just another
good reason to use composition rather that inheritance.


Raymond

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to