If I iterate over (key,value) pairs in Dict, or keys(dict), or values(dict), using multiple iterations, but not modifying the dict between iterations, is it guaranteed that I get the objects in the same order? (which is “random”, but I don’t care as long as it is consistent).
Looking at the implementation, this seems to be so, but I don’t know if this is something I can rely on (could not find it in the documentation).
Probably the best method (at least semantically) would be to convert the Dict into an OrderedDict (from DataStructures), this would freeze the order for later usage.
Since I am only using it a few times, and always linearly after I finished accumulating values, it turns out that collecting and working on that is the fastest solution.