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
Alexander Kozlovsky 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 me
On Sun, 21 May 2006 16:19:29 +0400,
Alexander Kozlovsky <[EMAIL PROTECTED]> wrote:
> How about small syntactic sugar:
> foo!bar!baz.x = y
> With this suggestion, mapping!identifier
> becomes fully equivalent to mapping["identifier"]
Take a look at the "Bunch" recipe in the Pyt
In article <[EMAIL PROTECTED]>,
Alexander Kozlovsky <[EMAIL PROTECTED]> wrote:
> Hello all!
> I have small silly syntax suggestion ()
>
> In many cases, keys in dictionary-like objects are strings,
> and moreover - valid Python identifiers. Something like:
>
> foo["bar"]["baz"].x = y
>