[Python-Dev] Call for defense of @decorators
Greg Ewing
greg at cosc.canterbury.ac.nz
Fri Aug 6 04:15:30 CEST 2004
"Phillip J. Eby" <pje at telecommunity.com>:
> That argument has been done to death several times in the last year
> here. Function attributes aren't a replacement for decorators.
Just to be clear, I wasn't arguing in my last post that decorators
should be replaced by function attributes. I was questioning the
assumption that "use cases exist for long decorators, therefore any
syntax for decorators needs to accommodate them".
In other words, a syntax for short decorators plus a syntax for long
function arguments might be sufficient.
There might even be a proof of sorts for this: arguments to the
decorator can be substituted with attributes on the function about to
be decorated, which the decorator extracts.
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury, | A citizen of NewZealandCorp, a |
Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. |
greg at cosc.canterbury.ac.nz +--------------------------------------+
More information about the Python-Dev
mailing list