instance attributes not inherited?

Xavier Morel xavier.morel at masklinn.net
Mon Jan 16 04:14:07 EST 2006


John M. Gabriele wrote:
> I'm having a hard time finding the documentation to the super() function.
> I checked the language reference ( http://docs.python.org/ref/ref.html )
> but didn't find it. Can someone please point me to the relevant docs on
> super?
> 
> help( super ) doesn't give much info at all, except that super is actually
> a class, and calling it the way we are here returns a "bound super object",
> but I don't yet see what that means (though I know what bound methods are).
> 

Super is a bit magic, quite complicated, and some people don't like it 
(basically, super is mainly to be used in complex inheritance case with 
diamond shape hierarchies and such, to automate the method resolution 
order).

If you want to give a try at understanding "super", you should read 
Guido's `Unifying types and classes in Python 2.2`, chapters on MRO, 
super and cooperative methods 
(http://www.python.org/2.2.3/descrintro.html#mro) (nb: you may also read 
the rest of the document, it lists all the magic introduced in the 
language with 2.2).



More information about the Python-list mailing list