[Python-ideas] Ordered Dictionary Literals

Richard Saunders richismyname at gmail.com
Wed Nov 11 17:33:30 CET 2009

Hey All,

We were exploring new features of Python 3.0 at our Tucson User's Group
here in Tucson (TuPLE: Tucson Python Language Enthusiasts), in particular,
the OrderedDict.  See


Has there been any discussion about making a "better" OrderedDict literal? I
some googling and didn't find anything.

Basically, the thought was there might be a place for a slightly better
literal for OrderedDict
in Python 3.0
 od = OrderedDict([('a',1),('b':2)])  # seems clumsy

The two ideas floated were:
  od = ['a':1, 'b':2, 'c':3]    # [ ] imply order, the ':' implies key-value


  od = o{'a':1, 'b':2, 'c':3}   # { } imply dict, o implies order

Apologies if this is the wrong place for this discussion.  There has been
a lot of opinions flying here at work and at TuPLE which I will be happy
to share if this is the right place. ;)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20091111/c361bfde/attachment.html>

More information about the Python-ideas mailing list