[Python-3000] ordered dict for p3k collections? (original) (raw)
Mark Summerfield mark at qtrac.eu
Tue Sep 11 16:06:32 CEST 2007
- Previous message: [Python-3000] [Python-3000-checkins] r58068 - in python/branches/py3k: Doc/library/exceptions.rst Doc/library/socket.rst Doc/whatsnew/2.6.rst Lib/test/test_urllib2net.py Lib/urllib2.py Modules/socketmodule.c
- Next message: [Python-3000] ordered dict for p3k collections?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-3000] [Python-3000-checkins] r58068 - in python/branches/py3k: Doc/library/exceptions.rst Doc/library/socket.rst Doc/whatsnew/2.6.rst Lib/test/test_urllib2net.py Lib/urllib2.py Modules/socketmodule.c
- Next message: [Python-3000] ordered dict for p3k collections?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]