Message183742
Text sounds correct to me. It says that imports should happen at the beginning of a module, and that the names of imported modules are placed in the module namespace. There is an implicit logical link between the two sentences, and the wording of “symbol table” may be not great at this stage of the tuto, but I don’t see that the text can be interpreted to mean that imports in a function will change the global namespace. Of course, *I* don’t see it because I’m not the target audience of the tutorial; if you know that import creates an assignment and that assignments have scopes, it’s logical that importing in a function does not create a global name, but beginners reading the tutorial may not know these things yet. So we could add an example of a module importing and using another module. If there is a part of the tuto where imports in functions are mentioned (and discouraged), then an example or comment there could also clarify that the imported module name is only local to the function. |
|
Date |
User |
Action |
Args |
2013-03-08 15:12:31 | eric.araujo | set | recipients:
+ eric.araujo, ezio.melotti, docs@python, ashwch, Piotr.Kuchta |
2013-03-08 15:12:30 | eric.araujo | set | messageid: <1362755551.0.0.215957852725.issue17383@psf.upfronthosting.co.za> |
2013-03-08 15:12:30 | eric.araujo | link | issue17383 messages |
2013-03-08 15:12:30 | eric.araujo | create | |
|