diff options
author | Barry Warsaw <barry@python.org> | 2012-07-31 20:03:09 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2012-07-31 20:03:09 (GMT) |
commit | dadebab42c87e29342de67501a6b280e547fb633 (patch) | |
tree | e472033f9865ed1be7043ae3e6c9be7e1ce67815 /Doc/reference/simple_stmts.rst | |
parent | cbc4c1930f864a872b2457768921af9903e5c1a6 (diff) | |
download | cpython-dadebab42c87e29342de67501a6b280e547fb633.zip cpython-dadebab42c87e29342de67501a6b280e547fb633.tar.gz cpython-dadebab42c87e29342de67501a6b280e547fb633.tar.bz2 |
Finally, a coherent set of terminology for all the lil' beasties involved.
Diffstat (limited to 'Doc/reference/simple_stmts.rst')
-rw-r--r-- | Doc/reference/simple_stmts.rst | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index f93f497..f212e5a 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -662,14 +662,17 @@ The :keyword:`import` statement Import statements are executed in two steps: (1) find a module, loading and initializing it if necessary; (2) define a name or names in the local -namespace (of the scope where the :keyword:`import` statement occurs). The -statement comes in two forms differing on whether it uses the :keyword:`from` -keyword. The first form (without :keyword:`from`) repeats these steps for each -identifier in the list. The form with :keyword:`from` performs step (1) once, -and then performs step (2) repeatedly. +namespace (of the scope where the :keyword:`import` statement occurs). +Step (1) may be performed recursively if the named module is a submodule or +subpackage of a parent package. + +The :keyword:`import` statement comes in two forms differing on whether it +uses the :keyword:`from` keyword. The first form (without :keyword:`from`) +repeats these steps for each identifier in the list. The form with +:keyword:`from` performs step (1), and then performs step (2) repeatedly. The details of step (1), finding and loading modules is described in greater -detail in the section on the :ref:`import machinery <importmachinery>`, which +detail in the section on the :ref:`import system <importsystem>`, which also describes the various types of packages and modules that can be imported, as well as all the hooks that can be used to customize Python's import. |