[Python-Dev] Proposal: add odict to collections

Talin talin at acm.org
Sun Jun 15 05:42:24 CEST 2008


Michael Foord wrote:
> Armin Ronacher wrote:
>> Hi,
>>
>> I noticed lately that quite a few projects are implementing their own
>> subclasses of `dict` that retain the order of the key/value pairs.
>> However half of the implementations I came across are not implementing
>> the whole dict interface which leads to weird bugs, also the performance
>> of a Python implementation is not that great.
>>
>>   
> 
> I'm +1 - but this proposal has been made many times before and people 
> always argue about what features are needed or desirable. :-(

There's been a lot of controversy/confusion about ordered dicts. One of 
the sources of confusion is that people mean different things when they 
use the term "ordered dict": In some cases, the term is used to mean a 
dictionary that remembers the order of insertions, and in other cases it 
is used to mean a sorted dict, i.e. an associative data structure in 
which the entries are kept sorted. (And I'm not sure that those are the 
only two possibilities.)

I would be more in favor of the idea if we could come up with a less 
ambiguous naming scheme.

-- Talin



More information about the Python-Dev mailing list