Nick Coghlan wrote:

I sometimes wish for a nice, solid lazy
module import mechanism that manages to avoid the potential deadlock
problems created by using import statements inside functions.

I created an ad-hoc one of these for PyGUI recently.
I can send you the code if you're interested.

I didn't have any problems with deadlocks, but I
did find one rather annoying problem. It seems that
an exception occurring at certain times during the
import process gets swallowed and turned into a
generic ImportError. I had to resort to catching
exceptions and printing my own traceback in order
to diagnose missing auto-imported names.

--
Greg
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to