cpython: 9df9931fae96 (original) (raw)

Mercurial > cpython

changeset 83486:9df9931fae96 3.3

#15575: Clarify tutorial description of when modules are executed. [#15575]

R David Murray rdmurray@bitdance.com
date Sun, 21 Apr 2013 16:58:36 -0400
parents 5b6ccab52a4d
children dac847938326 d03784713786
files Doc/tutorial/modules.rst
diffstat 1 files changed, 2 insertions(+), 1 deletions(-)[+] [-] Doc/tutorial/modules.rst 3

line wrap: on

line diff

--- a/Doc/tutorial/modules.rst +++ b/Doc/tutorial/modules.rst @@ -72,7 +72,8 @@ More on Modules A module can contain executable statements as well as function definitions. These statements are intended to initialize the module. They are executed only -the first time the module is imported somewhere. [#] +the first time the module name is encountered in an import statement. [#] +(They are also run if the file is executed as a script.) Each module has its own private symbol table, which is used as the global symbol table by all functions defined in the module. Thus, the author of a module can