Skip to content

not-is-test

Pythonstyleno fixdefault: off

Reports an identity test negated in front of the expression: not a is b.

a is not b is the operator for it. The prefix form is the same test, but a reader may take it as (not a) is b.

To fix, write a is not b.

Reported
a = b = 1
not a is b
not a is not b
a is not b
python:
lint:
rules:
not-is-test: warn # off (default), warn, error

Suppress one line with sudsy-disable-next-line not-is-test in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
ruff E714 full