Hacker News new | ask | show | jobs
by aerovistae 4019 days ago
Whoa, hold on, since when is 'is' preferred over '=='? What kind of python are you writing over there? Those are for totally different purposes. One tests equality while the other tests identity.
1 comments

For example, 'if x == None' versus 'if x is None'. The latter is to be preferred (since identity is faster and more clear than comparison), but you see the former sometimes.
Yes that's the only case I know of where 'is' is regularly used.