Don*_*Gar 7 python twisted pylint pyephem
我非常喜欢让pylint告诉我,如果我使用的是不存在的成员.然而,我的新项目是使用twisted和ephem模块,这似乎混淆了pylint.
如何在不关闭E1101的情况下解除这些(不正确的)pylint警告,并且不会在每个相关呼叫周围发出警告删除注释?
E1101: 8,0: Module 'twisted.internet.reactor' has no 'run' member
E1101: 49,25:sunrise_next: Module 'ephem' has no 'Sun' member
E1101: 63,26:sunset_next: Module 'ephem' has no 'Sun' member
Run Code Online (Sandbox Code Playgroud)
答案是在有问题的类的pylintrc中添加如下所示的部分.
# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set).
ignored-classes=SQLObject,twisted.internet.reactor,ephem
Run Code Online (Sandbox Code Playgroud)