[Python-Dev] Re: PEP 318: Decorators last before colon (original) (raw)

Phillip J. Eby pje at telecommunity.com
Wed Mar 31 22:39:05 EST 2004


At 10:19 PM 3/31/04 -0500, Terry Reedy wrote:

"Mike Thompson" <mike.spam.filter at day8.com.au> wrote in message news:c4fk3i$ujb$1 at sea.gmane.org... > as: [classmethod] > def func(args)

I think I like this better than the bare list as a prefix. as: suites could be explained as an optional prefix suite for functions just as else: suites are optional suffix suites for if/while/for. Hmmm...

'as' is not currently a keyword, and making it so would break any programs that use it as a name.

On the bright side, if it were made a keyword, then this would be possible:

as [classmethod] def func(*args): pass

Really, of the current "before the def" proposals, I think I like Samuele's:

*[classmethod] def func(*args): pass

approach the best. The '*' seems to say "special note, pay attention". :)



More information about the Python-Dev mailing list