Setting hash salt for individual calls [duplicate]
问题 This question already has answers here : Disable hash randomization from within python program (2 answers) Closed 3 years ago . I'm looking for a way to set python's hash() salt for individual calls to the function. In the docs, I've only found PYTHONHASHSEED which sets the salt for all calls to hash() . However, I need hash to always get me the same result when called by specific objects, but I don't want to force the entire application to use the same (predictable) salt. Context: In python2