On 23 Jan 2009 18:50:00 GMT, Duncan Booth <duncan.bo...@invalid.invalid> wrote:
[snip]

BTW, if you ever find you are starting to write multi-threaded applications
then you'll really regret it if you reuse code which does imports from
inside functions. If two or more threads try to import a module
simultaneously then one of them might find it that not everything is
defined in the module exists when it tries to use it.

What makes you say this?  There is an import lock (beyond the GIL) which
should prevent a thread from ever seeing a partially initialized module.

Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to