I know that, in Julia, dictionaries do not preserve the original ordering in which keys has been inserted as described here, but do dictionaries (and sets) constructed with a given insertion order preserve the arbitrary ordering they use between runs? This is relevant since it would mean that the arbitrary order can be assumed stable between runs, for example, if I run the following code the order is preserved
dictionary = Dict(1 => 77, 2 => 66, 3 => 1, 50 => 2)
print(collect(keys(dictionary)))
since at each run it always prints
[50, 2, 3, 1]
This is just to show what I mean, in general is this true for all key types (or even for integers)? in this question there is an answer by @PM 2Ring which describes that for Python sets this is not true for all types since
By default, the hash() values of str, bytes and datetime objects are “salted” with an unpredictable random value