[Python-3000] A super() idea - no _getframe() involved
Aahz
aahz at pythoncraft.com
Wed Apr 19 15:44:36 CEST 2006
On Wed, Apr 19, 2006, Guido van Rossum wrote:
>
> Regarding the syntax, IMO *if* we use this we should do it so that you
> can write
>
> super.foobar(args)
>
> where currently you'd write
>
> super(ClassName, self).foobar(args)
>
> 'super' could be a new keyword. In 3.0 we could just make the keyword
> expand to a magic built-in function with the appropriate arguments
> (the magic cell and the first function argument). We could probably
> introduce this in 2.6 if the super object, when called, would return
> itself; then IMO no __future__ statement would be required since
> existing code using super would continue to work.
-1 on keyword in 2.x -- my company already has our own super() function
that does call-stack crawling and works with classic classes (since we
don't dare convert to new-style classes). We can't be the only ones.
I shan't argue too forcefully, though; it wouldn't be that hard to
rename it.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"LL YR VWL R BLNG T S"
More information about the Python-3000
mailing list