~ubuntu-branches/ubuntu/saucy/python2.7/saucy-proposed

« back to all changes in this revision

Viewing changes to Doc/tutorial/modules.rst

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-05-15 19:15:16 UTC
  • mto: (36.1.23 sid)
  • mto: This revision was merged to the branch mainline in revision 87.
  • Revision ID: package-import@ubuntu.com-20130515191516-zmv6to904wemey7s
Tags: upstream-2.7.5
ImportĀ upstreamĀ versionĀ 2.7.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
 
72
72
A module can contain executable statements as well as function definitions.
73
73
These statements are intended to initialize the module. They are executed only
74
 
the *first* time the module is imported somewhere. [#]_
 
74
the *first* time the module name is encountered in an import statement. [#]_
 
75
(They are also run if the file is executed as a script.)
75
76
 
76
77
Each module has its own private symbol table, which is used as the global symbol
77
78
table by all functions defined in the module. Thus, the author of a module can
550
551
.. rubric:: Footnotes
551
552
 
552
553
.. [#] In fact function definitions are also 'statements' that are 'executed'; the
553
 
   execution of a module-level function enters the function name in the module's
554
 
   global symbol table.
 
554
   execution of a module-level function definition enters the function name in
 
555
   the module's global symbol table.
555
556