Brett Cannon <br...@python.org> added the comment:
Thanks for the idea, Stefan, but I'm going to close this as something we don't want to do. `importlib.reload()` purposefully takes a module object as that's what is going to get mutated/changed and it must already exist. The other importlib functions take a string because the module might not even exist yet. And as Serhiy said, reloading is a bit dangerous and shouldn't be taken lightly. It primarily exists to reload a module when you're working in the REPL and editing a file live, not for anything fancy during execution of production code. So keeping it squarely targeted the REPL case and making it a bit harder for other cases is a good thing in my opinion. ---------- resolution: -> rejected stage: -> resolved status: open -> closed versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue43037> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com