3 ms·
Only if you want to determine whether two integers are the same object and not just two objects that look similar. `is` is for identity, whereas `==` is for equ
by DonaldPShimoda 9y ago
Only if you want to determine whether two integers are the same object and not just two objects that look similar. `is` is for identity, whereas `==` is for equivalence.
Idiomatically, you generally only see `is` used for comparison to `None`. Sometimes developers want to check identity, and you'd use `is` there too (but I don't have a handy example offhand).