Proposed implementation for an Ordered Dictionary
Fri Feb 27 01:05:35 CET 2009
Raymond Hettinger <python at rcn.com> writes:
> > What about using a second dictionary
> My first attempt used exactly that approach and it works fine
> though it does complicate the code quite a bit and slows down
> all of the common operations by a constant factor.
Ehh, I guess I'm not surprised at the slowdown and extra complexity
from the second dict. Oh well. If the module really turns out to be
really used a lot, another (messy) approach would be to write a C
extension that uses a doubly linked list some day.
More information about the Python-list