[Python-Dev] Plea for simpler decorator syntax,
in addition to pie-shaped syntax
Gustavo Niemeyer
niemeyer at conectiva.com
Thu Aug 5 19:46:19 CEST 2004
> IMO, the most common uses of decorators will be to define properties,
> and class and static methods. IMO, these uses would be better served
> by a simpler syntax:
>
> def classmethod foo(cls, ...):
> ...
>
> This simplified syntax only allows names to specify decorators. It
> could allow multiple names, although I'm not sure it should,
>
> I find this *far* more readable and obvious than any of the other syntaxs
> I've seen propsed.
Agreed.
> Those applications that *need* decorator arguments could use the more
> complex pie-shaped notation.
I wouldn't care to define a decorator function to introduce arguments,
and force every decorator function to take a single argument.
--
Gustavo Niemeyer
http://niemeyer.net
More information about the Python-Dev
mailing list