PEP 372 -- Adding an ordered directory to collections
bearophileHUGS at lycos.com
bearophileHUGS at lycos.com
Mon Jun 16 06:24:16 EDT 2008
Oh, very good, better late than never.
This is my pure Python version, it performs get, set and del
operations too in O(1):
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498195
Working with C such data structure becomes much faster, because it can
use true pointers.
Then another data structure that may be named SortedDict can be
created, that keeps items in their natural order (instead of the
insertion order).
Bye,
bearophile
More information about the Python-list
mailing list