multiple inheritance of a dynamic list of classes?

Michele Simionato michele.simionato at gmail.com
Thu Feb 15 11:55:52 EST 2007


On Feb 13, 9:14 am, Peter Otten <__pete... at web.de> wrote:
> "Avoid inheritance" would be almost as justified :-)

Yep, I strongly agree. Inheritance is overrated, as Guido says.
For what concerns the debate of multiple vs single inheritance, yes it
is true
that multiple inheritance is worse, but even single inheritance can be
bad
enough, unfortunately :-(
The issue is that inheritance *does not scale*: i.e. in simple
situations
it works fine, but it has the tendence to becomes unmanageable very
easily
In other words, if you are inheriting just two or three methods it may
works, but when
you start having dozens of methods inherited from different sources,
your code will
become to look as spaghetti code.
This is why in general I (as many people here) suggest delegation over
inheritance.

  Michele Simionato




More information about the Python-list mailing list