[Python-ideas] Assignment decorators (Re: The Descriptor Protocol...)

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Mar 9 00:38:45 CET 2011

Steven D'Aprano wrote:
> The feature we're discussing is not an enhanced form 
> of decoration, it is an enhanced form of *assignment*. I think Raymond 
> has got it right, the only appropriate syntax is a variation of the 
> assignment syntax.

I don't entirely agree with that. There are currently two
existing constructs in Python for creating objects that know
their own name, 'def' and 'class'. They don't look like forms
of assignment -- rather, they follow the pattern

   <keyword> <name> <some other stuff>

This leads me to think that any further such constructs should
follow a similar pattern.


More information about the Python-ideas mailing list