From: Brett Cannon Date: Fri, 20 Apr 2012 19:57:46 +0000 (-0400) Subject: Issue #14628: Document the fact that import always returns the module X-Git-Tag: v3.3.0a3~136 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1b5123aae5632193caace8b1427d767429b6850b;p=python 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). --- diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index 3bd08942c0..1b46e42936 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -776,7 +776,8 @@ within the package being imported. :data:`__package__` is optional but should 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