[Python-Dev] LinkedHashSet/LinkedHashMap equivalents

Raymond Hettinger python at rcn.com
Thu Mar 10 04:21:18 CET 2005

> Gee, I just found out I could have used an OrderedDict today.  (We're
> using a dict that we're now having to add an auxilliary list to to
> when keys are added.)  (This isn't particularly an argument in favor
> adding OrderedDict to stdlib, but it's another use case.  Each dict
> contains a dict value; the subkeys from later-added keys are supposed
> override earlier subkeys.  The original implementation relied on
> being unique, but that doesn't work for our new business

If I read the proposal correctly, order would be determined by when the
key was first encountered.  Presumably, that would mean that the related
value would also be the first encountered (not overridden by later-added
keys as dictated by your business requirements).  


More information about the Python-Dev mailing list