我正在使用 Eclipse 中的交互式控制台,并且重新加载不会在我的代码中显示更新的函数。我的代码是:
def func1():
return 1
def func2():
return 2
但是当我把它改成
def afunc1():
return 1
def func2():
return 2
def func1():
return 3
并运行 imp.reload(TestMod),我得到了一个'module' object has no attribute 'afunc1()'
.
此外,有时函数已加载,有时未加载。