I wrote a module called mymodule.py
which has the function
def funcion(x):
return x
So I imported this function into a code like
from mymodule import function
and worked normally.
Then I wanted to change the function to
def function(x):
return 2*x
but the code continues to work as in the previous version of function
, with return x
. How do I reimport the function
object without restarting the kernel? Do you know of any function similar to importlib.reload()
for objects in Python 3?