None
EN
PEP 844: ``public`` and ``private`` builtins
[]
Newest Python PEPs
This PEP proposes adding two new builtin functions, public() and private() , which document the public interface of a module by keeping its __all__ synchronized with the names actually defined to be public in that module.
Because @public and @private exist to keep the __all__ module global in sync, only module-level objects may be declared.
Excluding names is the job of @public : as soon as any name in the module is marked public, __all__ exists, and everything not marked public is excluded automatically.
The decorated object is returned unchanged:If the module does not already define __all__ , public() creates it as an empty list before appending.
The declaration of a module’s public interface is a fundamental and often requested property, especially as code bases grow.