[issue43037] Importlib reload by module name (String)
Serhiy Storchaka
report at bugs.python.org
Wed Jan 27 08:37:53 EST 2021
Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:
It works as documented. reload() argument must be a module. If you have only module name, sys.modules is a mapping of module names to modules. It is trivial to combine two things in one line.
And why do you want to reload a module by name (without having a reference to module itself)? In general, reload() should be used with caution, it is easy to misuse it.
----------
nosy: +brett.cannon, eric.snow, ncoghlan, serhiy.storchaka
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43037>
_______________________________________
More information about the Python-bugs-list
mailing list