[Python-3000] Fixing super anyone?

Guido van Rossum guido at python.org
Thu Apr 19 00:54:09 CEST 2007


On 4/18/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Guido van Rossum wrote:
> > Is anyone available to write up a PEP on how to turn super into a
> > keyword? Inside regular and class methods, super.foo(args) should be
> > equivalent to super(ThisClass, self).foo(args).
>
> As I'm still not convinced that super() is very
> useful in the first place, I'm not sure I want
> it made into a keyword at all.

Well, I and others *do* find it useful (indispensible, in fact) for
writing classes that support cooperative multiple inheritance. That's
not a sport for casual users, but if you need it, super is the only
game in town.

> I'd rather see syntactic support for making a
> normal inherited method call without danger of
> using the wrong class, e.g. if you change a
> base class but forget to update inherited calls
> to match.

You will get that too with the proposal.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list