[issue9626] OderedDict.viewitems() does not preserve item order
Alexey Luchko
report at bugs.python.org
Tue Aug 17 15:14:35 CEST 2010
New submission from Alexey Luchko <luch at ank-sia.com>:
OrderedDict.viewitems() is expected to preserve item order like items() do
>>> from collections import OrderedDict
>>> d = OrderedDict([(1, 2), ("a", "b")])
>>> d.items()
[(1, 2), ('a', 'b')]
But it does not:
>>> list(d.viewitems())
[('a', 'b'), (1, 2)]
----------
components: Library (Lib)
messages: 114117
nosy: luch
priority: normal
severity: normal
status: open
title: OderedDict.viewitems() does not preserve item order
type: behavior
versions: Python 2.7
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9626>
_______________________________________
More information about the Python-bugs-list
mailing list