move to end, in Python 3.2 Really?

nn pruebauno at latinmail.com
Mon Jan 17 21:51:01 EST 2011


I somehow missed this before. I like most of the additions from
Raymond Hettinger. But the api on this baffles me a bit:

>>> d = OrderedDict.fromkeys('abcde')

>>> d.move_to_end('b', last=False)

>>> ''.join(d.keys)
'bacde'

I understand that "end" could potentially mean either end, but would
"move_to_end" and "move_to_beginning" not have been clearer?



More information about the Python-list mailing list