[Python-Dev] Timing for Py2.4

Tim Peters tim.one at comcast.net
Tue Mar 23 22:45:38 EST 2004


[Guido]
> I was actually hoping to also get decorators in,

FYI, the 2.4 planning mtg assumed that.  I channeled you thusly:  "Guido
really wants to get them in, but isn't in love with a syntax yet."

> but I haven't decided on the syntax yet.

Command-line option <wink>.

> It's between before or after the argument list.

Or *is* the argument list.  The arguments will be bound to new local name
__args__, which will get magically bound to an instance of a subclass of
collections.deque, for efficient shifting of args off both ends.  We need a
subclass to allow efficent access by argument name too.

Argument names will be extracted from optional decorators whose names begin
with "__arg_":

    def sum2(staticmethod, __arg_x, __arg_y):
        return x+y
        # or
        return sum(__args__)
        # or
        return __args__.byname("x") + __args__[-1]
        # or
        return sum(__args__.pop() for dummy in __args__)

it's-easier-when-you-have-one-to-reject-without-regret-ly y'rs  - tim




More information about the Python-Dev mailing list