[Python-ideas] Assignment decorators (Re: The Descriptor Protocol...)
Larry Hastings
larry at hastings.org
Wed Mar 9 00:50:59 CET 2011
On 03/08/2011 06:38 PM, Greg Ewing wrote:
> 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.
>
I like this avenue of thought. But here we run into a problem: what
should the keyword be? The same criteria that makes a good keyword
(short, meaningful, in this case a noun) also makes for a good
identifier. So any good obvious choice ("var", "field", "value") is
going to have lots of uses as an identifier in existing code.
Not that this proposal was doing that well so far,
/larry/
More information about the Python-ideas
mailing list