Why does Python’s hash of infinity have the digits of π?

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?

3 Answers
3

Leave a Comment