Re: dict!ident as equivalent of dict["ident"]

2006-05-22 Thread Alexander Kozlovsky
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 pars

Re: dict!ident as equivalent of dict["ident"]

2006-05-21 Thread Alexander Kozlovsky
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 me