There were some posts recently discussing whether it's poor style to put
import statements inside functions. I recently got reminded that there's
one very good reason to avoid it: Python has an import lock that blocks
more than one thread from executing import statements. Putting import
statements inside functions that might be called in a threaded
environment is asking for deadlock trouble.
--
Aahz (aa**@pythoncraft.com) <*> http://www.pythoncraft.com/
"Do not taunt happy fun for loops. Do not change lists you are looping over."
--Remco Gerlich, comp.lang.python