This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author macquigg
Recipients
Date 2004-06-15.22:43:24
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
In both the Library Reference, section 2.1, and in the 
Python 2.2 Quick Reference, page 19, the explanation 
for this function is:

super( type[, object-or-type]) 
   Returns the superclass of type. ...

This is misleading.  I could not get this function to work 
right until I realized that it is searching the entire MRO, 
not just the superclasses of 'type'.  See 
comp.lang.python 6/11/04, same subject as above, for 
further discussion and an example.

I think a better explanation would be:

super(cls,self).m(arg)

   Calls method 'm' from a class in the MRO (Method 
Resolution Order) of 'self'.  The selected class is the first 
one which is above 'cls' in the MRO and which 
contains 'm'.

The 'super' built-in function actually returns not a class, 
but a 'super' object.  This object can be saved, like a 
bound method, and later used to do a new search of the 
MRO for a different method to be applied to the saved 
instance.
History
Date User Action Args
2007-08-23 14:22:39adminlinkissue973579 messages
2007-08-23 14:22:39admincreate