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

Thomas Gagne tgagne at ix.netcom.com
Sat Oct 7 00:56:58 EDT 2000


Alex Martelli wrote:

> "Grant Edwards" <ge at nowhere.none> wrote in message
> news:wAqD5.4401$WJ3.791257 at ptah.visi.com...
>     [snip]
> > Personally, I would like some way to refer to _a_ superclass.
> > If there's more than one, it's an error or undefined or
> > arbitrarily picks one. Almost all of the code I see/write uses
>
> self.__class__.__bases__[0] satisfies this request, I think.
>
> Would the saving of about three characters to call it, say,
> self.__class__.__super__ be worth introducing a 'shortcut'...?
>
> Alex

Three characters wouldn't be enough of a shortcut.  I really ought to be
something as short as 'super', which says all it needs to.  I supposed I've
never found much need for multiple inheritance (except maybe in GP) but not in
the planned ecologies which are the programs I write.

I like the idea of 'super' being useful when there's single inheritence, and
its behavior being undefined, or even an error, when thee are multiples.


--
.tom






More information about the Python-list mailing list