Afaik the import sets the module in the importing module's context only after the code in the imported module is run.
Edit: Oh, you don't mean in the importing module's globals, you mean `sys.modules`. Yeah that works!
Edit: Oh, you don't mean in the importing module's globals, you mean `sys.modules`. Yeah that works!