[issue43037] Importlib reload by module name (String)

Stefan Mosoi report at bugs.python.org
Wed Jan 27 09:35:17 EST 2021


Stefan Mosoi <st3f4n2006 at gmail.com> added the comment:

The motivation behind my request is as follow: 
I have a dynamic set class (i don't "know" it) and calling
__module__ for that class return a string, reload requires Module(and i don't think __module__ will be changed to module). The other functions (import, import_module) recieve a string. 
 
Maybe is trivial to add a one liner, but it's a bit confusing to call another function in another module than importlib.

Also (not from what i found when searching) there is no way to get the module from name without using import_module/import. 

maybe i found the solution, but there might be others that aren't so lucky.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43037>
_______________________________________


More information about the Python-bugs-list mailing list