Live Feed/Python/Fact Record
Python logo
Python
api 96% Confidence Gate August 5, 2026

PEP 844: ``public`` and ``private`` builtins

Python introduces two new builtin functions, public() and private(), to manage module interface visibility. These functions act as decorators to synchronize the __all__ attribute with defined class and function names.

Verified State Diff

Comparison Mode:
- Previous State
Module visibility was managed manually by explicitly defining and updating the __all__ list at the module level.
+ Verified New State
Module visibility is managed via @public and @private decorators or function calls, which automatically synchronize the __all__ list.

Impact & Verification Analysis

WHO IS AFFECTED

Python library maintainers and software developers managing module interfaces.

WHY IT MATTERS

It improves code maintainability and reduces API surface errors by centralizing visibility declarations, moving away from error-prone manual list management.

Full Fact Overview

PEP 844 addresses the long-standing manual maintenance burden of the __all__ list in Python modules. By implementing @public and @private decorators, developers can declare visibility at the point of definition, reducing the risk of synchronization errors between internal implementation and the exported API surface. The proposal also includes a functional call form for constants or objects that do not support decoration, ensuring comprehensive coverage of module-level exports.

Multi-Source Evidence Chain (1)

PEP 844: ``public`` and ``private`` builtinsPython
TRACKED ENTITY
Explore all historical Python changes
View Python Hub ➔