An inheritance question: getting the name of the "one up" class

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Tue Mar 31 04:16:47 EDT 2009


On Tue, 31 Mar 2009 01:29:50 -0300, Gabriel Genellina wrote:

>> Oh, and while the gurus are at it, what would be the advantage (if any)
>> of changing, say
>>    Primate.__init__(self)
>> to
>>     super(Human, self).__init__()
> 
> None, if you use single inheritance everywhere.


But there's no disadvantage to using super with single inheritance (and 
new-style classes).



> super is very tricky; see:
> http://fuhm.net/super-harmful/
> and
> http://www.artima.com/weblogs/viewpost.jsp?thread=236275


As I understand it, the trickiness only comes about when you have diamond 
diagrams in your MRO.



-- 
Steven





More information about the Python-list mailing list