[Python-3000] Removing __var

Giovanni Bajo rasky at develer.com
Sun Oct 1 23:20:56 CEST 2006


Guido van Rossum wrote:

> But I'm all for adding syntactic sugar to Py3k. Can someone please
> draft a proto-PEP? I think the compiler could treat super as a
> reserved word and turn super.foo(args) into __super__(<thisclass>,
> self).foo(args). Or something. Please be sure you understand the
> issues (e.g. you can't rely on self.__class__). It would be great if
> it worked inside class methods too. For static methods it don't see
> how it ca work since there's no instance; or perhaps it should just
> use the static hierarchy? Try not to go overboard; KISS etc.

Would you want this PEP to address the fact that, in most cases, you just want
to forward all the arguments to super call (aka super.foo(*args, **args)), ala
Dylan's nextmethod? Or is this what you meant with KISS? :)

One idea would be just:

   super     (or super())

which is equivalent to:

   super.<thismethodname>(<all arguments as passed>)

Let me also state the obvious: *args,**kwargs is not always available, so
having a short syntax to "do the most common thing" is going to be very useful.

Giovanni Bajo



More information about the Python-3000 mailing list