[Python-Dev] Re: PEP 318 bake-off?

Guido van Rossum guido at python.org
Thu Apr 1 19:10:03 EST 2004


> How about adding:
> 
> 2b) Prefix list with repeated keyword:
> 
> def [funcattrs(foo=42), deprecated, overrides, classmethod]
> def foo(cls, arg1, arg2):
>      pass
> 
> class [singleton]
> class foo:
>      pass
> 
> 3a) Prefix suite with repeated keyword:
> 
> def:
>      funcattrs(foo=42)
>      deprecated, overrides, classmethod
> def foo(cls, arg1, arg2):
>      pass

You know, that one occurred to me in the shower, because it should
parse easily.  But I immediately rejected it as too weird.  The
stutter doesn't have any semantic connotation to it and is bound to
confuse source-scanning tools.

(The nice thing about plain prefix list syntax is that tools which
look for 'def' but don't process other statements are just as
oblivious to it as they are to current decorator syntax.)

--Guido van Rossum (home page: http://www.python.org/~guido/)




More information about the Python-Dev mailing list