exampleDict = {'a':1, 'b':2, 'c':3, 'd':4}
The above dictionary was initially repeated in the following order:
b=2
d=4
a=1
c=3
Then I moved about a thousand files to my code, and now iterates in the following order:
d=4
a=1
c=3
b=2
I know that order is internally stored as hashmap, but what can cause a change in internal order?
Edit: I don't need to keep order, so I will stick with using dict. I'm just wondering why this happened. I thought order was not guaranteed, but as soon as it has its own arbitrary internal order, it sticks to it for future iterations.
source
share