I want to insert a key behind a given key in a OrdedDict
.
Example:
my_orderded_dict=OrderedDict([('one', 1), ('three', 3)])
I want 'two' --> 2
to get into the right place.
In my case I need to update the OrdedDict
in-place.
Background
SortedDict of Django (which has an insert()
) gets removed: https://code.djangoproject.com/wiki/SortedDict