If I'm working on a module, say mymod, it's convenient to start an interpreter by importing __all__ from the module, like so:
>>> from mymod import *
Since I'm making changes to mymod, using importlib.reload() is handy. Alas, because I didn't explicitly import the module itself, it doesn't work:
>>> from importlib import reload
>>> reload(mymod)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'mymod' is not defined
so I need to restart my Python interpreter session and issue the from mymod import * again to pick up the changes.
Is there a way to reload mymod, even though I'm actually importing from it, not the module itself?