[Python-Dev] Attributes access with dict

Eugene Toder eltoder at gmail.com
Fri Mar 25 02:44:05 CET 2011


> My point is that I don't see the distinction between avoiding using dicts
> with well-known keys and wanting to access a dict with attribute access
> (which is where this started). Seems the same to me.

I think using dict with well-known keys is what makes people want dict
with attribute access.
My point is that this is not a very good use of dict -- normally dict
keys are also data. If they are not, something more specific should be
used, though before namedtuple (and still in many other scripting
languages) there were no good alternatives.

Eugene


More information about the Python-Dev mailing list