"Super()" confusion

Benjamin Peterson benjamin at python.org
Tue Feb 10 14:40:56 EST 2009


Marc 'BlackJack' Rintsch <bj_666 <at> gmx.net> writes:

> 
> On Tue, 10 Feb 2009 02:02:43 +0000, Benjamin Peterson wrote:
> 
> > Jean-Paul Calderone <exarkun <at> divmod.com> writes:
> >> Consider whether you really need to use super().
> >> 
> >> http://fuhm.net/super-harmful/
> > 
> > This article chiefly deals with super()'s harm in multiple inteheritance
> > situations. For the simple case, though, like that presented by the OP,
> > I believe super() is perfect.
> 
> But for the simple cases it is unnecessary because it was invented to 
> deal with multiple inheritance problems.

super() is great for single inheritance because it furthers the DRY principle
(base classes are not scattered through the code), and rather ugly use of
unbound methods. 







More information about the Python-list mailing list