In <[EMAIL PROTECTED]>, George Sakkis
wrote:

> While we're at it, although it's not strictly a naming convention
> issue I still waste brain cycles on where to put the import statements
> that are used only once or twice in a module. Should
> (1) all imports be at the global scope at the top of the module, or
> (2) be imported in the function or method they are actually used ?
> 
> […]
> 
> Reasons for (2)
> ---------------
> - Point of import closer to point of use; easy to notice if a given
> import is not used any more after refactoring.

`pylint` reports unused imported names.  I don't follow PEP8 only if it's
not possible otherwise.  But cyclic imports are bad anyway.  :-)

And if the import is *really* expensive and only needed in some special
circumstances.

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to