How do I make pylint recognize twisted and ephem members?

末鹿安然 提交于 2020-04-02 11:54:48

问题


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.

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

回答1:


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


来源:https://stackoverflow.com/questions/17142236/how-do-i-make-pylint-recognize-twisted-and-ephem-members

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!