PEP8 states that the check Noneshould be performed with is None. The same is true for single individuals. But PEP8 also states that the equality of True and False should not be performed using the operator, iseven worse than ==:
Yes: if greeting:
No: if greeting == True:
Worse: if greeting is True:
I understand that the first of them is the most beautiful and the most pythonic, but sometimes I am in a situation where I want to clearly show that I am comparing with Trueor False. How isworse than ==in this situation?
source
share