PyDocs

Nav

Data Types

OrderedDict.move_to_end

collections

method of OrderedDict · Added in 3.2
  • OrderedDict.move_to_end(key, last=True)
Move an existing element to the end (or beginning if last is false).

Raise KeyError if the element does not exist.
1 Example
>>> d = OrderedDict.fromkeys('abcde')
>>> d.move_to_end('b')
>>> ''.join(d)
'acdeb'
>>> d.move_to_end('b', last=False)
>>> ''.join(d)
'bacde'
from the Python docs
See Also
No see-alsos for collections/OrderedDict.move_to_end
0 Notes
No notes for OrderedDict.move_to_end