Skip to content

no-duplicate-dunder-all-entry

static module __all__ declarations should list each exported name once

Why

Duplicate exports add noise to a module's public contract and commonly reveal copy-paste mistakes in generated or maintained facade lists.

Fix

Remove each later duplicate while preserving the first declaration of the exported name.

Examples

Before — flagged Duplicate name in a package export list
diagnostics/__init__.py
__all__ = ["Diagnostic", "AnalysisReport", "Diagnostic"]
After — preferred Unique names in a package export list
diagnostics/__init__.py
__all__ = ["Diagnostic", "AnalysisReport"]