mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
#17938: merge with 3.3.
This commit is contained in:
commit
1fbb773c29
1 changed files with 0 additions and 16 deletions
|
@ -737,22 +737,6 @@ in the module's namespace which do not begin with an underscore character
|
||||||
to avoid accidentally exporting items that are not part of the API (such as
|
to avoid accidentally exporting items that are not part of the API (such as
|
||||||
library modules which were imported and used within the module).
|
library modules which were imported and used within the module).
|
||||||
|
|
||||||
The :keyword:`from` form with ``*`` may only occur in a module scope.
|
|
||||||
Attempting to use it in class or function definitions will raise a
|
|
||||||
:exc:`SyntaxError`.
|
|
||||||
|
|
||||||
.. index:: single: __all__ (optional module attribute)
|
|
||||||
|
|
||||||
The *public names* defined by a module are determined by checking the module's
|
|
||||||
namespace for a variable named ``__all__``; if defined, it must be a sequence
|
|
||||||
of strings which are names defined or imported by that module. The names
|
|
||||||
given in ``__all__`` are all considered public and are required to exist. If
|
|
||||||
``__all__`` is not defined, the set of public names includes all names found
|
|
||||||
in the module's namespace which do not begin with an underscore character
|
|
||||||
(``'_'``). ``__all__`` should contain the entire public API. It is intended
|
|
||||||
to avoid accidentally exporting items that are not part of the API (such as
|
|
||||||
library modules which were imported and used within the module).
|
|
||||||
|
|
||||||
The :keyword:`from` form with ``*`` may only occur in a module scope. The wild
|
The :keyword:`from` form with ``*`` may only occur in a module scope. The wild
|
||||||
card form of import --- ``import *`` --- is only allowed at the module level.
|
card form of import --- ``import *`` --- is only allowed at the module level.
|
||||||
Attempting to use it in class or function definitions will raise a
|
Attempting to use it in class or function definitions will raise a
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue