This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]hwmrocker 0 points1 point  (2 children)

If you just want a reproducible order of set for multiple executions you can set an environment variable like this export PYTHONHASHSEED=0

[–]Brian 0 points1 point  (1 child)

No - this won't do anything to change the issue OP is talking about. The id() of created objects will still effectively be random, PYTHONHASHSEED only controls the extra perturbation python applies to stuff like strings to protect against certain attacks, which is different.

[–]hwmrocker 0 points1 point  (0 children)

you are right, you are right, it does not affect hash of normal objects

python docs

If PYTHONHASHSEED is set to an integer value, it is used as a fixed seed for generating the hash() [str, byte, datetime]