Skip to content

undefined-export

Pythoncorrectnessno fixdefault: warnpython/ruff

Reports a name in __all__ that the module does not bind.

from module import * raises AttributeError for a name that __all__ lists and the module does not define, and the mistake (a misspelling or a removed function) stays hidden until someone imports the module with a star.

To fix, correct the name or remove it from __all__.

Reported
__all__ = ["present", "missing"]
present = 1
...
...
python:
lint:
rules:
undefined-export: warn # off, warn (default), error

Enabled by the presets: python/ruff.

Suppress one line with sudsy-disable-next-line undefined-export 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 F822 full