I saw in this useful Q&A that one can use reload(whatever_module)
or, in Python 3, imp.reload(whatever_module)
.
My question is, what if I had said from whatever_module import *
to import? Then I have no whatever_module
to refer to when I use reload()
. Are you guys gonna yell at me for throwing a whole module into the global namespace? :)
I agree with the "don't do this generally" consensus, but...
The correct answer is:
import X
reload(X)
from X import Y # or * for that matter