Mercurial > cpython-lru_cache-weakref
diff Doc/tutorial/modules.rst @ 83488:a1421d28393b 2.7
#15575: Clarify tutorial description of when modules are executed.
| author | R David Murray <rdmurray@bitdance.com> |
|---|---|
| date | Sun, 21 Apr 2013 17:14:40 -0400 |
| parents | 6cb6c332c24f |
| children | 2e1c39456219 |
line wrap: on
line diff
--- a/Doc/tutorial/modules.rst Sun Apr 21 13:04:10 2013 -0700 +++ b/Doc/tutorial/modules.rst Sun Apr 21 17:14:40 2013 -0400 @@ -71,7 +71,8 @@ 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
