Blogs / Personal blogs

Omair Majid

omairmajid.com

Omair's announcements, thouughts and code

Popular posts
1
Total points
103
HN comments
91
Rank
#20,911 personal

Visit omairmajid.com → RSS feedOn Hacker News Jan 2025 – Jan 2025

Software Engineering 1Programming Languages 1

1

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…