News for hackers. Stuff that matters.
Re:Python dicts are now ordered by kragen on Friday February 07, 2020 @01:32PM (#22269098)
No, it isn't random enough for that.
Re:Python dicts are now ordered by jarekkruk on Friday February 07, 2020 @02:25PM (#22269741)
IIRC it used to just start iteration at a pseudorandom index and then iterate normally. I looked at it couple years ago, don't know if they changed it.
Re:Python dicts are now ordered by kragen on Saturday February 08, 2020 @05:15PM (#22278848)
It seems to do that, but I think it also tweaks the hash function for each newly created map, because in the code linked from https://news.ycombinator.com/item?id=22278753 I'm not getting rotations of the same iteration order when I generate two maps. There doesn't seem to be any randomness in mapiternext() itself.

You could imagine that the hash function itself might do an adequate job of randomizing the order of the cards, though, especially if salted with a per-map salt. SipHash, for example, would probably not have any detectable biases in the distribution of the permutations thus produced. But whatever hash function Golang is using for my structs has an easily visible bias, as described in that comment.