On Nov 24, 11:59 am, Carsten Haese <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > > AFAIK the order is deterministic as long as you don't alter the dict between > > iterations. However, this is an implementation detail. > > It's not an implementation detail. It's documented behavior. Thus > quothhttp://docs.python.org/library/stdtypes.html#mapping-types-dict: > > """ > If items(), keys(), values(), iteritems(), iterkeys(), and itervalues() > are called with no intervening modifications to the dictionary, the > lists will directly correspond. > """
Changing the value attached to an existing key is a "modification to the dictionary", but it's hard to see how that would change the iteration order. "the lists will directly correspond"? What does that mean? Why not "the lists will be equal i.e. list1 == list2"? How about "Provided that keys are neither added nor deleted, the order of iteration will not change"? -- http://mail.python.org/mailman/listinfo/python-list