[issue5397] PEP 372: OrderedDict

Jim Jewett report at bugs.python.org
Mon Mar 2 03:43:41 CET 2009


Jim Jewett <jimjjewett at users.sourceforge.net> added the comment:

I would try to make it more explicit that updates do not reset the 
order, but deleting a item and re-inserting it *does*.  (So it isn't 
the first insertion of the key, it is the first that hasn't yet been 
followed by a deletion.)

Maybe change:

"""
When iterating over an ordered dictionary,
the items are returned in the order their keys were first added.
"""

to [removed "first", added longer explanation]

"""
When iterating over an ordered dictionary,
the items are returned in the order their keys were added.  (This 
implies that updating an item to a new value does not reset the order, 
but deleting the item and re-inserting it moves the item to the end.)
"""

----------
nosy: +jimjjewett

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5397>
_______________________________________


More information about the Python-bugs-list mailing list