mirror of
https://github.com/python/cpython.git
synced 2025-11-02 19:12:55 +00:00
Issue #25500: Fix the language reference to not claim that import
statements search for __import__ in the global scope. Thanks to Sergei Lebedev for finding the documentation bug.
This commit is contained in:
parent
f17c20076c
commit
f4f25fe576
2 changed files with 10 additions and 5 deletions
|
|
@ -29,11 +29,10 @@ such as the importing of parent packages, and the updating of various caches
|
||||||
a name binding operation.
|
a name binding operation.
|
||||||
|
|
||||||
When calling :func:`__import__` as part of an import statement, the
|
When calling :func:`__import__` as part of an import statement, the
|
||||||
import system first checks the module global namespace for a function by
|
standard builtin :func:`__import__` is called. Other mechanisms for
|
||||||
that name. If it is not found, then the standard builtin :func:`__import__`
|
invoking the import system (such as :func:`importlib.import_module`) may
|
||||||
is called. Other mechanisms for invoking the import system (such as
|
choose to subvert :func:`__import__` and use its own solution to
|
||||||
:func:`importlib.import_module`) do not perform this check and will always
|
implement import semantics.
|
||||||
use the standard import system.
|
|
||||||
|
|
||||||
When a module is first imported, Python searches for the module and if found,
|
When a module is first imported, Python searches for the module and if found,
|
||||||
it creates a module object [#fnmo]_, initializing it. If the named module
|
it creates a module object [#fnmo]_, initializing it. If the named module
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,12 @@ Library
|
||||||
- Issue #25624: ZipFile now always writes a ZIP_STORED header for directory
|
- Issue #25624: ZipFile now always writes a ZIP_STORED header for directory
|
||||||
entries. Patch by Dingyuan Wang.
|
entries. Patch by Dingyuan Wang.
|
||||||
|
|
||||||
|
Documentation
|
||||||
|
-------------
|
||||||
|
|
||||||
|
- Issue #25500: Fix documentation to not claim that __import__ is searched for
|
||||||
|
in the global scope.
|
||||||
|
|
||||||
Tests
|
Tests
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue