[Python-ideas] Dict-like object with property access

MRAB python at mrabarnett.plus.com
Wed Feb 1 02:06:18 CET 2012


On 01/02/2012 00:42, Ethan Furman wrote:
> Terry Reedy wrote:
>>  On 1/31/2012 1:06 PM, Eric Snow wrote:
>>
>>>  +1 for reconsidering the d.[name] / d.(name) / d!name syntax.
>>
>>  d.[name] is too much like d[name] The . that modifies the meaning of
>>  'name' is too far away.
>>
>>  d.(name) is like d.name except to me the () means to use the value of
>>  name rather than 'name' itself. This is just what you are trying to say.
>>  I believe () is used elsewhere with that meaning. I could live with this.
>>
>>  d!name has the advantage? of no brackets, but just looks crazy since !
>>  meant 'not' in Python.
>
>
> I'm not a fan of any of the .[], .(), .{} patterns, nor of .! .
>
.() looks the most sensible to me.

> What about the colon?
>
> d:name  #use the value of name
>
Surely you jest? :-)



More information about the Python-ideas mailing list