[Python-Dev] LinkedHashSet/LinkedHashMap equivalents

Thomas Heller theller at python.net
Wed Mar 9 22:19:39 CET 2005


Steven Bethard <steven.bethard at gmail.com> writes:

> Thomas Heller <theller at python.net> wrote:
>> [About an ordered dictionary]
> [snip] 
>> I cannot understand why people are against adding it to stdlib (after
>> the name, the implementation, and the exact place have been decided).
>> It's certainly a useful data type, isn't it?
>
> Well, that was basically the question I posed.  So far I've seen only
> one use for it, and that one is better served by adding a function to
> itertools.

Hm, removing duplicates from a list is an algorithm, not a data
structure.  And the code you posted (no offense intended) is, also imo,
faster written by an experienced programmer than located in some module.
OTOH, I see no problem adding it to itertools.

>  What use do you have for it other than filtering
> duplicates from a list while retaining order?

If this were the only use case, you are right.  I cannot remember the
use case I once had right now, and probably the code has been rewritten
anyway.  But I assume use cases exist, otherwise there weren't so many
recipes for the ordered dictionary.

Thomas



More information about the Python-Dev mailing list