On 8 February 2012 01:48, Lei Cheng <pat.ins...@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 -- http://mail.python.org/mailman/listinfo/python-list