Checking if a variable or parameter is None should only be done when you expect that it can be None. Doing so when the
variable is always None or never None is confusing at best. At worse, there is a bug and the variable is not updated
properly.
This rule raises an issue when expressions X is None, X is not None, X == None or X != None are
constant, i.e. X is always None or never None.
Code examples
Noncompliant code example
def foo():
my_var = None
if my_var == None: # Noncompliant: always True.
...
Compliant solution
def foo(my_var):
if my_var == None:
...