This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Piotr.Kuchta
Recipients Piotr.Kuchta, docs@python
Date 2013-03-07.23:55:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1362700500.92.0.448355159104.issue17383@psf.upfronthosting.co.za>
In-reply-to
Content
In the 2.7 tutorial, chapter on modules:

 http://docs.python.org/2/tutorial/modules.html#more-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
History
Date User Action Args
2013-03-07 23:55:00Piotr.Kuchtasetrecipients: + Piotr.Kuchta, docs@python
2013-03-07 23:55:00Piotr.Kuchtasetmessageid: <1362700500.92.0.448355159104.issue17383@psf.upfronthosting.co.za>
2013-03-07 23:55:00Piotr.Kuchtalinkissue17383 messages
2013-03-07 23:55:00Piotr.Kuchtacreate