Ordered dict by default

Bryan Olson fakeaddress at nowhere.org
Thu Feb 5 12:36:06 EST 2009


Stephen Hansen wrote:
> Ooh, as an addendum... I found one case where I want insertion-and-update
> order: meaning that its an ordered dictionary that maintains insertion
> order, but
> an update to a particular item moves that item to the back so an update behaves
> like del d[key]; d[key] = value in terms of the key order.
> 
> "Ordered Dictionaries" are a bit fuzzy. :)

A few bits fuzzy. Is the following True or False if dict is insert-ordered?

    dict(a=6, b=7) == dict(b=7, a=6)



-- 
--Bryan



More information about the Python-list mailing list