Why are there no ordered dictionaries?

bonono at gmail.com bonono at gmail.com
Wed Nov 23 06:57:47 CET 2005

Alex Martelli wrote:
> What you can obtain (or anyway easily simulate in terms of effects on a
> loop) through an explicit call to the 'sorted' built-in, possibly with a
> suitable 'key=' parameter, I would call "sorted" -- exactly because, as
> Bengt put it, there IS a sorting algorithm which, etc, etc (if there
> wasn't, you couldn't implement it through the 'sorted' built-in!).
> So, any ordering that can be reconstructed from the key,value data held
> in a dict (looking up some combinations of those in an external table is
> nothing special in these terms) falls under this category.  But, a dict
> does not record anything about what was set or changed or deleted when;
> any ordering which requires access to such information thus deserves to
> be placed in a totally separate category.
But I can also record these changes in a seperate table which then
becomes a "sorted" case ?

More information about the Python-list mailing list