How to reload python module imported using `from module import *`

I agree with the “don’t do this generally” consensus, but…

The correct answer is:

from importlib import reload
import X
reload(X)
from X import Y  # or * for that matter

Leave a Comment