Edward Elliott wrote:
With this suggestion, mapping!identifier
becomes fully equivalent to mapping[identifier]
Penny-wise, pound-foolish. Saves 3 character strokes at the cost of a new
special-purpose operator which only works in limited circumstances. To
avoid parsing
Roy Smith wrote:
Define a class (perhaps a subclass of dict, if you like)
with a __getattr__ method. Then you can just do
foo.bar.baz.x = y
with no changes needed to the language.
I think, your solution is very error-prone. If such enhanced
dictionary contains keys key, what is meaning