It looks like you want to want to reload an already loaded module. You can use the reload function from the importlib library.
from importlib import reload
foo = reload(foo)
please note that the above code will work only for python 3.4 and above for python 3.0 to 3.3 import imp instead of import importlib