diff -r 78ad3da30e8a stdlibchanges.rst --- a/stdlibchanges.rst Sat Jan 02 09:11:24 2016 -0600 +++ b/stdlibchanges.rst Tue Mar 22 18:15:16 2016 +0100 @@ -49,6 +49,34 @@ .. _Python Cookbook: http://code.activestate.com/recipes/langs/python/ +Private vs. public API +'''''''''''''''''''''' +If a module or package defines ``__all__`` that authoritatively defines the +public interface. Modules with ``__all__`` SHOULD still respect the naming +conventions (leading underscore for private members) to avoid confusing users. +Modules SHOULD NOT export private members in ``__all__``. + +Names imported into a module a never considered part of its public API unless +documented to be so or included in ``__all__``. + +Methods / functions / classes and module attributes whose names begin with a +leading underscore are private. + +If a class name begins with a leading underscore none of its members are +public, whether or not they begin with a leading underscore. + +If a module name in a package begins with a leading underscore none of its +members are public, whether or not they begin with a leading underscore. + +If a module or package doesn't define ``__all__`` then all names that don't +start with a leading underscore are public. + +All public members MUST be documented. Public functions, methods and classes +SHOULD have docstrings. Private members may have docstrings. + +Where in the standard library this means that a module exports stuff that isn't +helpful or shouldn't be part of the public API we need to migrate to private +names and follow our deprecation process for the public names. Adding a new module -------------------