PEP 843: Export Statement for DRY Re-exports
PEP 843 introduces a formal 'export' statement to Python to manage public API surfaces. This feature allows developers to explicitly define which symbols are re-exported from a module without manual assignment.
Verified State Diff
Impact & Verification Analysis
Python library maintainers and software architects managing large-scale codebases.
It reduces boilerplate code and improves the maintainability of public APIs by providing a standardized, language-level mechanism for namespace curation.
Full Fact Overview
The proposal addresses the architectural friction in Python library design where internal implementation structures often differ from the intended public-facing API. Currently, developers must manually re-import or assign symbols in __init__.py files to curate public namespaces, which is error-prone and verbose. PEP 843 introduces a native syntax to declare exports, enabling a cleaner separation between internal module trees and the public-facing API surface, effectively automating the 'DRY' (Don't Repeat Yourself) principle for module re-exports.