News for hackers. Stuff that matters.
Re:WTF Python: Exploring and understanding Python through su... by masklinn on Thursday February 11, 2021 @06:10AM (#26100297)
> Checking for reference equality (comparing pointers) is such a niche requirement it should be hidden behind stronger syntactic vinegar.

In python it’s common due to `None`, which you really want to check by identity. Other placeholders as well. This is such a major use case that in 3.9 `is` was moved out of the generic `compare_op` instruction and into its own.

And because __eq__ can be overridden, aside from being noticeably slower `x == None` is not truly reliable.

There are no comments on this comment yet.