Variable inheritance

Roman Suzi rnd at onego.ru
Tue May 22 03:58:34 EDT 2001


On Tue, 22 May 2001, kosh wrote:

> Roman Suzi wrote:
> > On 22 May 2001, Paul Foley wrote:
> > 
> >> On Tue, 22 May 2001 07:45:41 +0400 (MSD), Roman Suzi wrote:
> >> 
> >> > Multiple inheritance says it bad design.
> >> 
> >> It *is* a bad design, but multiple inheritance certainly isn't a sign
> >> of a bad design.  You seem to be saying MI is inherently bad.
> >> [MI without multiple dispatch is broken, though...]
> > 
> > MI is in most cases bad. Why not aggregation instead?
> > 
> > Sincerely yours, Roman A.Suzi
> 
> Specifically why do you think MI in most cases is bad in python. From 
> looking at other languages due to design decisions with the langauge I can 
> see how it would be bad in most cases in C++ or Java. However the same 
> issues I see causing a problem in those langauges seem not to exist in 
> python. 

The badness of multiple inheritance is not bounded with the underlying
language. It's bad design decision, because it artificially combines two
classes, which very rarely reflect real situation. (I can't even give
an example where this could be justified). And doesn't eat the complexity.

In Python 1.5.2 standard modules only 2 modules use it:

SocketServer.py and pdb.py

And I doubt it is good thing to do. Just blindly reusing 
code of two classes != good OOdesign.

Sincerely yours, Roman A.Suzi
-- 
 - Petrozavodsk - Karelia - Russia - mailto:rnd at onego.ru -
 





More information about the Python-list mailing list