[Python-Dev] [Python-3000] Pre-pre PEP for 'super' keyword

Ron Adam rrr at ronadam.com
Mon Apr 30 11:43:16 CEST 2007


Delaney, Timothy (Tim) wrote:

> What I'm proposing is that the `super = super_factory()` line be
> implicit in this case, resulting in the following code behaving
> identically:
> 
>     class A(object):
>         def f(self):
>             def inner():
>                 return 'A' + super.f()
> 
>             print inner()


As Guido pointed out it has some resemblance to how import works, but I 
also think there is resemblance to the context of how global is used.  So 
if it is made into a keyword, could it work like the global keyword?

    class A(object):
        def f(self):
            def inner():
            	super f
            	return 'A' + f()

            print inner()

Cheers,
    Ron



More information about the Python-Dev mailing list