[docs] [issue17383] Error in documentation /2/tutorial/modules.html#more-on-modules

Piotr Kuchta report at bugs.python.org
Fri Mar 8 00:55:00 CET 2013

New submission from Piotr Kuchta:

In the 2.7 tutorial, chapter on modules:


I think the last sentence in this paragraph is incorrect:

"Modules can import other modules. It is customary but not required to place all import statements at the beginning of a module (or script, for that matter). The imported module names are placed in the importing module’s global symbol table."

This is not true:

>>> def foo(): import sys
>>> foo()
>>> sys.path
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'sys' is not defined

assignee: docs at python
components: Documentation
messages: 183715
nosy: Piotr.Kuchta, docs at python
priority: normal
severity: normal
status: open
title: Error in documentation /2/tutorial/modules.html#more-on-modules
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the docs mailing list