On 4/29/07, Tim Delaney <[EMAIL PROTECTED]> wrote:
> I've been intending to write up a PEP for fixing super, but I haven't had
> time to get to it.

Calvin Spealman has the most recent draft. I hope he will incorporate
this into his draft.

> 1. 'super' becomes a keyword, that returns a super object for the instance
> method currently being executed.

So it is a "keyword" in the sense that None is a keyword; not in the
stronger sense that "if" is a keyword?

> 4. super objects are callable, and calling them will execute the super
> method with the same name as the instance method currently being executed.
> Lookup of this method occurs when the instance method is entered.
>
>     class A(object):
>         def f(self):
>             pass
>
>     class B(A):
>         def f(self):
>             super() # Calls A.f(self)

> If you want name lookup to occur at the time of the call, you can explicitly
> specify the method name (just like with any other super attribute):
>
>     class A(object):
>         def f(self):
>             pass
>
>     class B(A):
>         def f(self):
>             super.f() # Calls A.f(self)

As long as you can be explicit, should the shortcut be a full
shortcut?  That is,

    def f(self, a, b=c, *args, **kwargs):
        super()    # passes the exact arglist that f got

vs

    def __init__(self, myvar, passed_var):
        super.__init__(self, passed_var)    # flags that you are
changing the args

-jJ
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to