Modern #Python dicts remember insertion order: d = {'a':10, 'b':20, 'c':30} list(d) # ['a', 'b', 'c'] d.pop('b') # remove 'b' d['b'] = 99 # re-add 'b' list(d) # ['a', 'c', 'b'] This applies in for loops, too!
What is the main advantage then of Ordered Dict? I confess I don't remember now (need to look up tomorrow)
They should make this optional. There's 15%-20% overhead in memory usage, just for using another internal list to track the insertion order.