[Python-Dev] LinkedHashSet/LinkedHashMap equivalents (original) (raw)

Jeff Bauer jbauer at rubic.com
Thu Mar 10 05:33:12 CET 2005


Thomas Heller <theller at python.net> wrote:

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

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.

I'm not specifically lobbying for its inclusion in stdlib, but I often find an ordered dict useful when I want both ordered and random access, e.g. situations:

In both cases, I could get by with other techniques, but I would use stdlib ordered dicts if they were available. I also prefer the term "ordered dict" to LinkedHashXXX.

Jeff Bauer Rubicon, Inc.



More information about the Python-Dev mailing list