'is' instead of == while comparing an object with None. While using obj == None, PyCharm advices to use 'is' instead of ==. I know None is a Singleton and the '==' operator can be overloaded by a custom object, so using is with None would be a better choice. But is this the only reason?
I think "is" is more readable
Readability, and identity checks are faster. Overloading should be sensible as well.
Обсуждают сегодня