Message183747
Ah, we have it: the tutorial distinguishes between “it’s customary to put imports near the top of the file” vs. “later in the file”, and you interpret it as “it’s customary to put imports at the module top level” vs. “import in any scope e.g. functions”. These are actually two different things, covered in different part of the docs: importing at module scope is very much recommended, as imports in functions can lead to nasty side-effects; and then there’s the style issue of putting imports at the beginning of the file, which is what the section we discuss is about. |
|
Date |
User |
Action |
Args |
2013-03-08 16:32:49 | eric.araujo | set | recipients:
+ eric.araujo, ezio.melotti, docs@python, jeffknupp, ashwch, Piotr.Kuchta |
2013-03-08 16:32:49 | eric.araujo | set | messageid: <1362760369.75.0.501326153581.issue17383@psf.upfronthosting.co.za> |
2013-03-08 16:32:49 | eric.araujo | link | issue17383 messages |
2013-03-08 16:32:49 | eric.araujo | create | |
|