↧
Answer by Martijn Pieters for What does "del sys.modules[module]" actually do?
sys.modules is the Python-accessible reference to the canonical data structure for tracking what modules are imported. Removing a name from that dictionary means that any future attempts to import the...
View ArticleWhat does "del sys.modules[module]" actually do?
As everyone knows, you can do del sys.modules[module] to delete an imported module. So I was thinking: how is this different from rewriting sys.modules? An interesting fact is, rewriting sys.modules...
View Article