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

Michal Wallace sabren at manifestation.com
Mon Oct 9 00:09:46 EDT 2000


On Mon, 9 Oct 2000, Greg Ewing wrote:

> 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.

Why do you need that? Calling a method of a class 
climbs the hierarchy for you, all the way up to where
the method was first defined or last overridden.

Cheers,

- Michal
------------------------------------------------------------------------
www.manifestation.com  www.sabren.com  www.linkwatcher.com  www.zike.net
------------------------------------------------------------------------





More information about the Python-list mailing list