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

Ethan Furman ethan at stoneleaf.us
Thu Mar 3 22:04:30 CET 2011


Greg Ewing wrote:
> Nick Coghlan wrote:
>> That is, something that
>> made it feasible to reference the name on the left hand side of a
>> simple assignment without needing to repeat it as a string with the
>> same contents.
>> I think we should have assignment decorators.
>> @decorator
> lhs = rhs
>> would be equivalent to
>> lhs = decorator('lhs', rhs)

That seems very verbose -- part of the issue for me is all the extra 
typing involved in specifying the name twice, and I don't think this is 
going to save many, if any, keystrokes.
~Ethan~


More information about the Python-ideas mailing list

AltStyle によって変換されたページ (->オリジナル) /