Skip to content

not-is-test (E714)#

Derived from the pycodestyle linter.

Fix is always available.

What it does#

Checks for negative comparison using not {foo} is {bar}.

Why is this bad?#

Negative comparison should be done using is not.

Example#

if not X is Y:
    pass
Z = not X.B is Y

Use instead:

if X is not Y:
    pass
Z = X.B is not Y