Omair Majid personal blog

Why is hash(-1) == hash(-2) in Python?

While browsing Reddit the other day waiting for my code to compile, I ran across this question on r/Python: is hash(-1) == hash(-2) an easter egg? Wait, is that really true? $ python Python 3.9.6 (default, Jun 29 2021, 00:00:00) [GCC 11.1.1 20210531 (Red Hat 11.1.1-3)] on linux Type "help", "copyright", "credits" or…
Points
103
HN comments
91
Submissions
1
Cited by
0 commenters

Programming LanguagesSoftware Engineering2025

On Hacker News

SubmittedTitle on HNPointsComments
Jan 7, 2025Why is hash(-1) == hash(-2) in Python? by alexmolas10391

Related posts from the same era