Is the order of a Python dictionary guaranteed over iterations?
Yes, the same order is guaranteed if it is not modified. See the docs here. Edit: Regarding if changing the value (but not adding/removing a key) will affect the order, this is what the comments in the C-source says: /* CAUTION: PyDict_SetItem() must guarantee that it won’t resize the * dictionary if it’s merely replacing … Read more