This rule raises an issue when a name listed in the __all__ property of a module has not been defined.
The __all__ property of a module is used to define the list of names that will be imported when performing a wildcard import of this
module, i.e. when from mymodule import * is used.
In the following example:
# mymodule.py def foo(): ... def bar(): ... __all__ = ["foo"]
Executing from mymodule import * from a different module will only import foo.
This list can only reference defined names, otherwise an AttributeError will be raised when the module is imported.
from mymodule import my_func __all__ = ["unknown_func"] # Noncompliant: "unknown_func" is undefined
from mymodule import my_func __all__ = ["my_func"]