[Python-ideas] Assignment decorators (Re: The Descriptor Protocol...)
Raymond Hettinger
raymond.hettinger at gmail.com
Fri Mar 4 11:15:29 CET 2011
On Mar 4, 2011, at 1:17 AM, Larry Hastings wrote:
>
> On 03/03/2011 05:59 PM, Raymond Hettinger discussed a possible language change (but later made it clear he wasn't actually proposing it):
>>
>> If there were going to be only one syntax change for Python 3.3, why not use it for something that adds a lot more expressive power:
>>
>> x = a!name # x = getattr(a, name)
>>
>> That bit of syntactic sugar might greatly expand our minds when it comes to dynamically creating and accessing attributes.
>
> We ran that up the ol' flagpole back in February 2007:
IIRC, the idea for a __getattr__ syntax was favorably received at first, but it then drowned in a sea of syntax bikeshedding which precluded any serious discussion of use cases and benefits.
Also remember that not all dead proposals have to stay dead. When generator expressions were first proposed, the PEP was rejected. The same was true for generator exceptions and for pushing data into running generators, yey these were ultimately accepted in the form of throw() and send().
For expressive power, I think Nick is on the right track by reviving the discussion about the make-statement.
Raymond
More information about the Python-ideas
mailing list