Skip to content

raise-not-implemented

Pythoncorrectnessno fixdefault: warnpython/ruff

Reports a raise of NotImplemented, with or without a call.

NotImplemented is the value that binary operators return to say “I cannot do this for that type”. It is not an exception, so raising it fails with a TypeError that hides the real reason.

To fix, raise NotImplementedError.

Reported
raise NotImplemented
raise NotImplemented("a")
raise NotImplementedError
...
python:
lint:
rules:
raise-not-implemented: warn # off, warn (default), error

Enabled by the presets: python/ruff.

Suppress one line with sudsy-disable-next-line raise-not-implemented 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 F901 full