[Python-Dev] Re: Re: Call for defense of @decorators

Delaney, Timothy C (Timothy) tdelaney at avaya.com
Tue Aug 10 00:40:59 CEST 2004


Walter Dörwald wrote:

> I can't understand why we can't have a new keyword for decorators.
> If I remember correctly the introduction of yield didn't result
> in such a public outcry. We'd have to change our programs once
> if a variable names collides with the new keyword, but that's better
> than having to look at @s for the rest of our Python days.

Not such a large outcry, but lots of us were concerned about "having to look inside the function for 'yield' to determine if it were a generator or a function" and were calling for a 'gen' or 'generator' keyword.

Strangely enough, exactly the *opposite* argument is now being used to prevent syntaxes such as:

    def func (args):
        @decorator

as was used then to allow:

    def func (args):
        yield value

Tim Delaney


More information about the Python-Dev mailing list