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

Dan Sommers me at privacy.net
Sun May 21 08:52:53 EDT 2006


On Sun, 21 May 2006 16:19:29 +0400,
Alexander Kozlovsky <alexander.kozlovsky at gmail.com> 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 Python Cookbook:

    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52308

Regards,
Dan

-- 
Dan Sommers
<http://www.tombstonezero.net/dan/>
"I wish people would die in alphabetical order." -- My wife, the genealogist



More information about the Python-list mailing list