[Tutor] import statements in functions?
shaleh at speakeasy.net
Mon Mar 21 23:42:16 CET 2005
Marcus Goldfish wrote:
> Is there a convention to be considered for deciding if import
> statements should be included in a function body? For example, which
> of these two module layouts would be preferable:
imports are cached. So once it is imported, it stays imported.
> The reason I consider the second form is that the module foo_special
> is only used by the code in specialFunction(), and detracts (IMHO)
> from understanding the rest of the code in the module.
and this is a good reason why you would perform the import inside the
More information about the Tutor