Needed: Real-world examples for Python's Cooperative Multiple Inheritance

Mark Wooding mdw at distorted.org.uk
Sun Nov 28 14:01:34 CET 2010


Steve Holden <steve at holdenweb.com> writes:

> It isn't. Even inheritance itself isn't as useful as it at first
> appears, and composition turns out in practice to be much more useful.
> That goes double for multiple inheritance.

Composition /with a convenient notation for delegation/ works fairly
well.  Indeed, this can be seen as the basis of Self.  But downwards
delegation -- where a superclass leaves part of its behaviour
unspecified and requires (concrete) subclasses to fill in the resulting
blanks -- is hard to express like this without some kind of means of
identifying the original recipient of the delegated message.  Once
you've done that, there isn't much of a difference between a superclass
and a component with implicit delegation.

-- [mdw]



More information about the Python-list mailing list