@@ -47,8 +47,9 @@ command::
4747
4848 >>> import fibo
4949
50- This does not enter the names of the functions defined in ``fibo `` directly in
51- the current symbol table; it only enters the module name ``fibo `` there. Using
50+ This does not add the names of the functions defined in ``fibo `` directly to
51+ the current :term: `namespace ` (see :ref: `tut-scopes ` for more details);
52+ it only adds the module name ``fibo `` there. Using
5253the module name you can access the functions::
5354
5455 >>> fibo.fib(1000)
@@ -75,27 +76,27 @@ These statements are intended to initialize the module. They are executed only
7576the *first * time the module name is encountered in an import statement. [# ]_
7677(They are also run if the file is executed as a script.)
7778
78- Each module has its own private symbol table , which is used as the global symbol
79- table by all functions defined in the module. Thus, the author of a module can
79+ Each module has its own private namespace , which is used as the global namespace
80+ by all functions defined in the module. Thus, the author of a module can
8081use global variables in the module without worrying about accidental clashes
8182with a user's global variables. On the other hand, if you know what you are
8283doing you can touch a module's global variables with the same notation used to
8384refer to its functions, ``modname.itemname ``.
8485
8586Modules can import other modules. It is customary but not required to place all
8687:keyword: `import ` statements at the beginning of a module (or script, for that
87- matter). The imported module names are placed in the importing module's global
88- symbol table .
88+ matter). The imported module names, if placed at the top level of a module
89+ (outside any functions or classes), are added to the module's global namespace .
8990
9091There is a variant of the :keyword: `import ` statement that imports names from a
91- module directly into the importing module's symbol table . For example::
92+ module directly into the importing module's namespace . For example::
9293
9394 >>> from fibo import fib, fib2
9495 >>> fib(500)
9596 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377
9697
9798This does not introduce the module name from which the imports are taken in the
98- local symbol table (so in the example, ``fibo `` is not defined).
99+ local namespace (so in the example, ``fibo `` is not defined).
99100
100101There is even a variant to import all names that a module defines::
101102
@@ -576,5 +577,5 @@ modules found in a package.
576577.. rubric :: Footnotes
577578
578579.. [# ] In fact function definitions are also 'statements' that are 'executed'; the
579- execution of a module-level function definition enters the function name in
580- the module's global symbol table .
580+ execution of a module-level function definition adds the function name to
581+ the module's global namespace .
0 commit comments