I can't seem to find this question answered anywhere, so... MacBook Pro OSX Sierra, Pycharm CE, Python 3.6.0 :: Anaconda 4.3.1 (x86_64).
Hi I try to import a function from a file, and it works. Then I change the function in the file, and the import doesn't work: there is no change to the operation of the function. I del the function, then re-import from file, still doesn't work.
Example, in the file new.py
def new(inp):
return(inp)
Then I import and call:
from new import new
new(9)
Out[249]:
9
Oh, I want to change the function in the file.
new.py changes to
def new(inp):
if type(inp) == str:
this = inp + "five"
return(this)
from new import new
new(9)
Out[250]:
9
Still just outputs the unmodified input "inp". Same deal if I
del new
from new import new
Doesn't make a difference if I change the name of the function (!= filename).