Second argument to super().

Steven Bethard steven.bethard at gmail.com
Mon Mar 14 18:46:36 EST 2005


Steve Holden wrote:
> John Roth wrote:
>> What happens with the second operand is a bit of
>> sleight of hand. The object returned from super()
>> gives you access to the methods on the next level up the
>> mro, however when you use it to invoke a method,
>> then the 'self' passed to that method is the second
>> object, not the instance returned from super().
>>
> This is a key point. I wonder whether we might use this thread to draft 
> a patch to the docs for submission on SourceForge?

Done:

www.python.org/sf/1163367

It's nowhere near perfect, but I think it at least somewhat more 
accurately reflects the actual workings of super.  If you have any good 
clarifications or rewordings, please feel free to add them to the tracker.


While I also agree that the documentation needs a major revamp to 
properly show the interworkings of all the new-style class components, a 
patch for super is about the best I can offer at the moment. =)

STeVe



More information about the Python-list mailing list