The hash of infinity in Python has digits matching pi:
>>> inf = float('inf')
>>> hash(inf)
314159
>>> int(math.pi*1e5)
314159
Is that just a coincidence or is it intentional?
_PyHASH_INF is defined as a constant equal to 314159.
I can't find any discussion about this, or comments giving a reason. I think it was chosen more or less arbitrarily. I imagine that as long as they don't use the same meaningful value for other hashes, it shouldn't matter.
Indeed,
sys.hash_info.inf
returns 314159. The value is not generated, it's built into the source code.
In fact,
hash(float('-inf'))
returns -271828, or approximately -e, in python 2 (it's -314159 now).
The fact that the two most famous irrational numbers of all time are used as the hash values makes it very unlikely to be a coincidence.