PY-MODU0005 · unused_explicit_export
Count explicit package exports no repository consumer uses.
This is a deterministic rule for python. Read its implementation.
Definition
Section titled “Definition”Read every name a Python module explicitly publishes through __all__ and count references
that enter through that public module and name. Report an export when no other source file uses
the route. Direct use of the defining module does not prove the extra public route useful.
Evidence
Section titled “Evidence”Each finding names the public name, the declaration it resolves to, and the exporting module. The value is the number of explicit exports with zero repository consumers.
Exceptions
Section titled “Exceptions”A library may intentionally publish an API only external clients use. Exclude that exact public boundary when the release contract proves the consumer exists outside the scanned repository. Dynamic string lookup is not counted because it does not state the import route statically.
Examples
Section titled “Examples”Bad
`pkg.__all__` lists `Engine`, but no repository file imports or accesses `pkg.Engine`.
Goodfrom pkg import Client consumes the explicit Client export and returns zero for that name.
References
Section titled “References”- Cites “The Python Language Reference”, the import statement and
__all__ - Cites “Refactoring”, Remove Dead Code