I'm a looking for some sets and dicts that keep the elements in an consistent order, regardless of insertion order, runtime environment and environment variables (like the PYTHONHASHSEED
variable).
The exact order is irrelevant and may vary wildly, but it's important that when such sets/dicts hold the same values/keys, that their iteration order will always be the same.
Now I'm aware I could just use a SortedList
, though to my understanding it won't eliminate duplicates.
Also I know of OrderedDict
, but as far as I understand all that does is preserve insertion order, which is not quite what I want.