[Python-3000] ordered dict for p3k collections?

Mark Summerfield mark at qtrac.eu
Tue Sep 11 16:06:32 CEST 2007


Hi,

Is there any chance that an ordered dict will be added to Python 3's
library?

I personally find such data structures v. useful in C++. I know that in
Python the sort function is v. fast, but often I prefer never to sort
but simply to use an ordered data structure in the first place.
(I'm aware that for ordered lists I can use the bisect module, but I
want an ordered key-value data structure.)

I think other people must find such things useful. There are three
implementations on the Python Cookbook site, and one on PyPI, all in
pure Python (plus I have my own implementation, also pure Python).

I would suppose that it would be better if it was implemented in C---for
example, my own pure Python ordered dict takes about eight times as long
to load in 18,000 items compared with loading the same into a dict.

-- 
Mark Summerfield, Qtrac Ltd., www.qtrac.eu



More information about the Python-3000 mailing list