Live Feed/Python/Fact Record
Python logo
Python
feature 96% Confidence Gate July 25, 2026

PEP 842: Module Exports

This PEP introduces a formal 'export' statement to Python modules to explicitly define public API surfaces. It provides a native mechanism to control variable visibility and module interface exposure.

Verified State Diff

Comparison Mode:
- Previous State
Module visibility is managed via the '__all__' list convention or underscore-prefixed naming, which are not enforced by the Python interpreter.
+ Verified New State
Introduction of a formal 'export' statement to explicitly define and enforce module-level public API visibility.

Impact & Verification Analysis

WHO IS AFFECTED

Python library maintainers, core developers, and software architects.

WHY IT MATTERS

It improves encapsulation, reduces accidental exposure of internal implementation details, and enables better tooling support for static analysis and tree-shaking.

Full Fact Overview

Currently, Python relies on the 'all' list convention or underscore-prefix naming conventions to signal private versus public module members, which are not strictly enforced by the interpreter. PEP 842 proposes a language-level 'export' statement that allows developers to explicitly declare which names are intended for external consumption. This shift moves Python closer to the module systems found in languages like JavaScript (ESM) or Rust, potentially allowing static analysis tools and IDEs to provide better autocompletion and dependency tracking by strictly defining module boundaries.

Multi-Source Evidence Chain (1)

PEP 842: Module ExportsPython
TRACKED ENTITY
Explore all historical Python changes
View Python Hub ➔