M
Mark Summerfield
I must think the API good because I have been implementing, in parallel
with this discussion, my own "OrderedDict" with a very similar API (this
is part of a larger project where I recently found the need to have a
well-implemented ordered dict). The only real omission I see is to allow
instantiating a "sorted dict" with an optional cmp function--to allow
the generalization of such features as case-independence, etc.
I tend to create different orderings by munging the keys rather than
by having optional cmp functions (as you'll see in the sorteddict.py
docstring). I've now put sorteddict on PyPI (with docs & tests):
http://pypi.python.org/pypi/sorteddict
I'm going offline for a week, so I'll see if there's any consensus or
progress when I'm back online, and then decide whether to do a PEP or
not.