[Python-ideas] Ordered Dictionary Literals

Terry Reedy tjreedy at udel.edu
Wed Nov 11 20:09:44 CET 2009


Richard Saunders wrote:
> 
> Hey All,
> 
> We were exploring new features of Python 3.0 at our Tucson User's Group

You should actually be using 3.1 if you are not.


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

Interesting idea, but this would mean making ordered dict a fundamental 
builtin type that all implementations must include rather than a 
somewhat optional module import. I do not think it qualifies, at least 
not yet.
> 
> or
> 
>   od = o{'a':1, 'b':2, 'c':3}   # { } imply dict, o implies order
> 
> Apologies if this is the wrong place for this discussion.

Perfect place for such idea.

Terry Jan Reedy




More information about the Python-ideas mailing list