Proposed implementation for an Ordered Dictionary

Raymond Hettinger python at rcn.com
Thu Feb 26 04:12:24 EST 2009


Here's a proposed implementation for Py2.7 and Py3.1:

    http://code.activestate.com/recipes/576669/

Would like you guys to kick the tires, exercise it a bit, and let me
know what you think.  The recipe runs under 2.6 and 3.0 without
modification so it should be easy to play with.

The main virtue of the proposed API is a near-zero learning curve.
The API is a same as for regular dictionaries but it remembers the
insertion order and used that for iteration, repr, etc.


Raymond




More information about the Python-list mailing list