如何使pylint识别扭曲和短暂的成员? [英] How do I make pylint recognize twisted and ephem members?

查看:135
本文介绍了如何使pylint识别扭曲和短暂的成员?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I very much like having pylint tell me if I'm using a non-existent member. However, my new project is using both twisted and the ephem modules, which seem to confuse pylint.

如何在不关闭E1101的情况下并且在每个相关呼叫周围不散布警告删除注释的情况下摆脱这些(不正确的)pylint警告?

How can I get rid of these (incorrect) pylint warnings without either turning off E1101 in general, and without sprinkling warning removal comments around every relevant call?

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

推荐答案

答案是使用有问题的类将以下内容添加到您的pylintrc中.

The answer is to add a section like the following to your pylintrc with the problematic classes.

# 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

这篇关于如何使pylint识别扭曲和短暂的成员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆