Why are there no ordered dictionaries?
Christoph Zwerschke
cito at online.de
Thu Nov 24 09:59:11 EST 2005
Fuzzyman schrieb:
> I'm going to add some of the sequence methods. I'm *not* going to allow
> indexing, but I will allow slicing.
>
> You can also do d[d.keys()[i]]
>
> This provides two ways of fetching values by index, so I don't want to
> add another.
And this would be probably faster than d.values()[i] in the usual
implementation where values() has to be built first as Carsten noted.
-- Chris
More information about the Python-list
mailing list