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

Terry Reedy tjreedy at udel.edu
Wed Feb 1 01:29:36 CET 2012

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.

Terry Jan Reedy

More information about the Python-ideas mailing list