[Python-checkins] cpython: Issue #14628: Document the fact that import always returns the module

brett.cannon python-checkins at python.org
Fri Apr 20 21:58:03 CEST 2012


http://hg.python.org/cpython/rev/150bd84e737e
changeset:   76438:150bd84e737e
user:        Brett Cannon <brett at python.org>
date:        Fri Apr 20 15:57:46 2012 -0400
summary:
  Issue #14628: Document the fact that import always returns the module
as found in sys.modules and not as what the loader returns (even
though it is required to by PEP 302).

files:
  Doc/reference/simple_stmts.rst |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst
--- a/Doc/reference/simple_stmts.rst
+++ b/Doc/reference/simple_stmts.rst
@@ -776,7 +776,8 @@
 be set to the name of package that contains the module or package (the empty
 string is used for module not contained in a package). :data:`__loader__` is
 also optional but should be set to the loader object that is loading the
-module.
+module. While loaders are required to return the module they loaded, import
+itself always retrieves any modules it returns from :data:`sys.modules`.
 
 .. index::
     exception: ImportError

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list