class super method
Ed Leafe
ed at leafe.com
Tue Apr 1 14:12:17 EDT 2008
On Apr 1, 2008, at 12:53 PM, Michele Simionato wrote:
> It is just that you did not run (yet) in a corner case of super. The
> interesting question would be: did any of your users run into issues
> using you library which is heavily relying on super? Especially when
> composing it with their own classes?
None so far, and our users are pretty good about reporting bugs!
> I personally have changed my opinion about multiple inheritance over
> the years.
> At the beginning I thought it was a very cool idea, but now I think it
> is a pretty bad idea. If I were to design a language, I would not
> implement multiple inheritance. In Python I never use multiple
> inheritance and actually I try very hard to avoid even single
> inheritance, preferring composition whenever it is viable.
I think MI is great as long as you understand how to use it. I would
never encourage anyone to mix dissimilar classes; that's just poor
design. But a well-designed mixin class is a wonderful thing.
I also don't consider inheritance and composition to be either/or
choices. Both can (and usually should) be part of a well-designed
application. In my experience, using either incorrectly can get you in
trouble.
-- Ed Leafe
More information about the Python-list
mailing list