Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 25187e6

Browse files
committed
#15575: Clarify tutorial description of when modules are executed.
1 parent bebe91a commit 25187e6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Doc/tutorial/modules.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ More on Modules
7272

7373
A module can contain executable statements as well as function definitions.
7474
These statements are intended to initialize the module. They are executed only
75-
the *first* time the module is imported somewhere. [#]_
75+
the *first* time the module name is encountered in an import statement. [#]_
76+
(They are also run if the file is executed as a script.)
7677

7778
Each module has its own private symbol table, which is used as the global symbol
7879
table by all functions defined in the module. Thus, the author of a module can

0 commit comments

Comments
 (0)