
Jan. 3, 2007
5:51 p.m.
"Guido van Rossum" <guido@python.org> wrote:
On 1/3/07, Josiah Carlson <jcarlson@uci.edu> wrote:
-1 . The only thing that possibly should be fixed is that modules should only be inserted into sys.modules after they have been imported completely and correctly.
I agree, but there's the wrinkle that during recursive imports you want partially-imported modules to be importable. I believe we once agreed on a solution but I don't recall what it was. Does anybody remember?
I don't remember what was agreed upon, but what about something like... try: newmodule = ... sys.modules[name] = newmodule handle_the_import(newmodule, ...) except: del sys.modules[name] raise - Josiah