From: R David Murray Date: Sun, 21 Apr 2013 20:58:36 +0000 (-0400) Subject: #15575: Clarify tutorial description of when modules are executed. X-Git-Tag: v3.3.2~70 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=25187e666b5fa53b7d2b1eeeb318f1267d87de13;p=thirdparty%2FPython%2Fcpython.git #15575: Clarify tutorial description of when modules are executed. --- diff --git a/Doc/tutorial/modules.rst b/Doc/tutorial/modules.rst index 78fe511c864e..e2ce0ef394a8 100644 --- 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