使用Spyder4和Python3.7,我将两个简单模块导入主模块
import module1
import module2
y = module1.func1(10)
z = module2.func2(10)
对于模块1:
def func1(x):
return 1+x
和模块2:
def func2(x):
return x+2
假设我想再次从module1调用func1。键入module1.
后,我的IDE的自动完成提示func1和func2,请参见WrongAutocomplete。但是,func2没有意义,因为它不在module1中,而是在module2中。选择func2实际上会导致AttributeError
如何从autocomplete中停用此类误导性建议
目前没有回答
相关问题 更多 >
编程相关推荐