9 Replaces a module with an instance of a types.ModuleType-based class 10 modulename is probably given by __name__ in that module 14 class AnInteriorClass(ModuleType): 21 Replace current module with an instance of Interior in sys.modules 22 Update the globals of this instance from the globals of the module 23 Keep a reference to the overwritten "scaffold" module to avoid GC 24 cf. https://mail.python.org/pipermail/python-ideas/2012-May/014969.html 28 w.__dict__.update(sys.modules[n].__dict__)
29 w._scaffold = sys.modules[n]
def __call__(self, Interior)
def __init__(self, modulename)