Inheritance problem?

Xavier Morel xavier.morel at masklinn.net
Fri Jan 6 18:02:34 CET 2006


Pierre Barbier de Reuille wrote:
> Xavier Morel a écrit :
>> Pierre Barbier de Reuille wrote:
>>
>>> Well, I would even add : don't use super !
>>> Just call the superclass method :
>>>
>>> MyClass.__init__(self)
>>>
>>>
>>>
>>> Simon Percivall a écrit :
>>>
>>>> Don't use self.__class__, use the name of the class.
>>>>
>> Bad idea if you're using new-style classes with a complex inheritance
>> hierarchy and multiple inheritance.
> 
> As a reference :
> 
> http://fuhm.org/super-harmful/
> 
> I may say this is the only place I ever saw what "super" *really* is
> for. The behavior is far too complex and misthought. All I can say is :
> don't use it ! It solves *nothing* and creates too many bugs in the long
> run.

My own encounter with the subject was Guido's "Unifying types and 
classes in Python 2.2" (http://www.python.org/2.2.3/descrintro.html#mro 
for the part on super itself), but I'll keep your link close by.



More information about the Python-list mailing list