Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #20155 > unrolled thread
| Started by | Arnaud Delobelle <arnodel@gmail.com> |
|---|---|
| First post | 2012-02-10 10:46 +0000 |
| Last post | 2012-02-10 10:46 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: when to use import statements in the header, when to use import statements in the blocks where they are used? Arnaud Delobelle <arnodel@gmail.com> - 2012-02-10 10:46 +0000
| From | Arnaud Delobelle <arnodel@gmail.com> |
|---|---|
| Date | 2012-02-10 10:46 +0000 |
| Subject | Re: when to use import statements in the header, when to use import statements in the blocks where they are used? |
| Message-ID | <mailman.5650.1328870810.27778.python-list@python.org> |
On 8 February 2012 01:48, Lei Cheng <pat.inside@gmail.com> wrote: > Hi all, > > In a py file, when to use import statements in the header, when to use > import statements in the blocks where they are used? > What are the best practices? > Thanks! Aside from other answers: in some rare cases, importing within a function can avoid circularity problems (e.g. A imports B which tries itself to import A) -- Arnaud
Back to top | Article view | comp.lang.python
csiph-web