Why does Python's hash of infinity have the digits of π? Asked 07 September, 2021 Viewed 1.1K times python math hash floating-point pi 52 Votes 3 Answers 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? python math hash floating-point pi Your reply on this question: Add Reply Cancel 3 Answer Order by Voted Recent Oldest Submit an answer Embed images in Question