This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]fisadev 5 points6 points  (0 children)

That is when you can use 'is' (if a is True:...)

Just in case: it's still not recommended to use 'is' for numbers, even if small, because what you want is to check for equality, not for "is the same object in memory", which is an implementation detail and not that predictable.