When reading such questions as Get unique values from a list in python you can see the remarks the order can be not preserved.
This is understandable. What is bugging me that it goes farther -- as I can see the execution is not even deterministic, i.e:
list(set(values_list))
I will get the unique values, the problem is with each run the outcome would be in different order. So this would mean set
(constructor or enumerator) is not deterministic.
I wonder how it happened? I don't see a reason why on single thread execution (?) you would get non-deterministic behavior.
Sure, one can sort the outcome to enforce deterministic behavior, but you can get such idea once you observe you have non-deterministic code at hand.
Update:
The essence of my code -- the file is a pickle with array of 10 000 strings (with 3 unique values).
combined = pickle.load(open("labels.p", "rb"))
label_keys = list(set(combined))
print(label_keys)
At each run I get different order. Oh, I use Python 3.6.4.