sorteddict [was a PEP proposal, but isn't anymore!]

thebjorn BjornSteinarFjeldPettersen at gmail.com
Sat Sep 29 13:58:11 EDT 2007


On Sep 29, 7:13 pm, Duncan Booth <duncan.bo... at invalid.invalid> wrote:
[...]
> Right now I think there are probably three dict variants needed: sorteddict
> (still waiting for a convincing use case), ordereddict (lots of use cases),
> and this one: stabledict.

What's stabledict? I'm assuming that ordereddict is a mapping that
maintains insertion order(?)

The only other mapping type I use very frequently is a dict where the
keys are limited to valid identifiers, and where attribute lookup
(d.foo) is defined as key lookup (d['foo']). It makes lots of code
easier to read (and write).

In the Smalltalk collection hierarchy SortedCollection is a subclass
of OrderedCollection, which implies to me that it'd be better to add
an ordereddict first.

-- bjorn




More information about the Python-list mailing list