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 eric.araujo
Recipients Piotr.Kuchta, ashwch, docs@python, eric.araujo, ezio.melotti
Date 2013-03-08.15:12:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1362755551.0.0.215957852725.issue17383@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-03-08 15:12:31eric.araujosetrecipients: + eric.araujo, ezio.melotti, docs@python, ashwch, Piotr.Kuchta
2013-03-08 15:12:30eric.araujosetmessageid: <1362755551.0.0.215957852725.issue17383@psf.upfronthosting.co.za>
2013-03-08 15:12:30eric.araujolinkissue17383 messages
2013-03-08 15:12:30eric.araujocreate