Home Tags About

Python: Are dict.keys() and dict.values() always the same order?

13 Jun 2012
python dict

Generally yes, the python document mentions this:

If items(), keys(), values(), iteritems(), iterkeys(), and itervalues() are called with no intervening modifications to the dictionary, the lists will directly correspond.