Hacker News new | ask | show | jobs
by wzdd 1024 days ago
To be honest this response underscores the problem with pages like this. In Python, strings and numbers are objects, and “is” tells you if they are the same object. You wouldn’t compare strings or numbers in C using a pointer comparison, and you shouldn’t do it in Python either. The fact that it works sometimes in cpython is a coincidence.

It’s interesting to learn about how the interpreter is implemented, but that’s about it.