我非常喜欢让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
答案 0 :(得分:9)
答案是在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