Needed: Real-world examples for Python's Cooperative Multiple Inheritance
michele.simionato at gmail.com
Mon Nov 29 11:44:10 CET 2010
On Nov 28, 2:01 pm, m... at distorted.org.uk (Mark Wooding) wrote:
> Steve Holden <st... 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]
For a long time I had the feeling that in a language with pattern
matching inheritance (both single and double) is basically useless.
You can easily define objects as functions responding to messages and
classes becomes useless. However I have never implemented a large
project with such techniques, so I
am not sure how much my gut feeling is sound. Apparently here at work
we are going to use Erlang in the near future and I hope to get my
hand dirty and see in practice how well one can work with a language
without inheritance. BTW, is there anybody here with experience on
such languages and caring to share his learned lessons?
More information about the Python-list