Message183715
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 |
|
Date |
User |
Action |
Args |
2013-03-07 23:55:00 | Piotr.Kuchta | set | recipients:
+ Piotr.Kuchta, docs@python |
2013-03-07 23:55:00 | Piotr.Kuchta | set | messageid: <1362700500.92.0.448355159104.issue17383@psf.upfronthosting.co.za> |
2013-03-07 23:55:00 | Piotr.Kuchta | link | issue17383 messages |
2013-03-07 23:55:00 | Piotr.Kuchta | create | |
|