super - is (should) it (be) a reserved word?

Greg Ewing see at my.signature
Sun Oct 8 22:17:37 EDT 2000


Alex Martelli wrote:
> 
> self.__class__.__bases__[0] satisfies this request, I think.

Not when there is more than one level of inheritance
involved. The class you want to find the base class
of isn't the class of self, it's the class where the
currently executing method was defined, and there's
currently nothing in Python that keeps track of that.

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list