Hi,
If I have two dictionaries containing identical values, can I be sure
that the items() method will return tuples in the same order?
I tried an experiment with CPython and it does appear to be the case.
>>> a=dict(a=1, b=1, c=2)
>>> b=dict(c=2, a=1, b=1)
>>> a
{'a': 1, 'c': 2, 'b': 1}
>>> b
{'a': 1, 'c': 2, 'b': 1}
>>> a.items()
[('a', 1), ('c', 2), ('b', 1)]
>>> b.items()
[('a', 1), ('c', 2), ('b', 1)]
Can I rely on this behavior?
Regards,
Will McGugan
blog: http://www.willmcgugan.com
--
http://mail.python.org/mailman/listinfo/python-list