【问题标题】:How do I make pylint recognize twisted and ephem members?如何让 pylint 识别 twisted 和 ehem 成员?
【发布时间】:2013-06-17 07:18:38
【问题描述】:

如果我使用的是不存在的成员,我非常喜欢让 pylint 告诉我。但是,我的新项目同时使用了 twisted 和 ehem 模块,这似乎让 pylint 感到困惑。

我怎样才能摆脱这些(不正确的)pylint 警告,而无需通常关闭 E1101,也无需在每个相关呼叫周围散布警告删除 cmets?

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

【问题讨论】:

标签: python twisted pylint pyephem


【解决方案1】:

答案是在您的 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

【讨论】:

    猜你喜欢
    • 2013-12-31
    • 2017-10-09
    • 2019-01-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-03
    相关资源
    最近更新 更多