[Tutor] quirky multiple inheritance example!?

Kent Johnson kent37 at tds.net
Fri Feb 10 14:01:51 CET 2006


Alan Gauld wrote:
>> It's worse than that - with MI if you call __init__() explicitly and 
>> the base classes call super().__init__(), one of the base class 
>> __init__() methods will be called twice. See 
>> http://fuhm.net/super-harmful/ for an example.
>>
> 
> Excellent link Kent. This just highlights how woefully inadequate the
> official documentation for super() is! It has also confirmed my belief
> that I'm better off sticking to explicit calls and worrying about diamond
> lattice situations only when I need to (which is very rarely indeed!).

That is my conclusion too. But to balance it out, here is a page that 
recommends using super() everywhere (in the Chandler project):
http://wiki.osafoundation.org/bin/view/Projects/UsingSuper

and here is the heated discussion on python-dev sparked by the "Super 
Considered Harmful" essay:
http://mail.python.org/pipermail/python-dev/2005-January/050656.html

Kent



More information about the Tutor mailing list