dict.keys() and dict.values() are always the same order, is it?

Menghan Zheng menghan412 at gmail.com
Mon Apr 19 23:03:08 EDT 2010


Hello!

Is it assured the following statement is always True?
If it is always True, in which version, python2.x or python3.x?

>>> a = dict()
...
>>> assert(a.values == [a[k] for k in a.keys()])
--> ?


Menghan Zheng



More information about the Python-list mailing list