The hash is the same. But a hash set has to use == in case of equal hashes (to avoid collisions).
It's not always the same:
>>> hash(float('nan')) 271103401 >>> hash(float('nan')) 271103657
It's not always the same: