"E1101" - "Class" 的实例没有 "method" 成员

"E1101" - Instance of "Class" has no "method" member

我 类 是这样组织的:

class One:
    def funcOne(self):
        doSomething()

class Two(One):
    def funcTwo(self):
        self.funcOne()

当我 运行 这样做时,它起作用了,并且 Python 的继承模型允许 Two 能够调用 funcOne

然而,运行 pylint 给我错误:

[E1101 (no-member), myscript] Instance of 'Two' has no 'funcOne' member

我已经看过 another question on the site,但那个问题涉及变量,唯一提出的解决方案是将它们放入字典中,而方法无法做到这一点。

我怎样才能pylint识别继承行为?


编辑:我是 运行 pylint 1.1.0,年龄大得离谱,也许这就是原因?

致电self.funcOne()

也class应该继承对象

class One(object):
    ...

原来我的 pylint 版本已经严重过时了。我是 运行 版本 1.1.0,更新到最新版本 1.6.4,警告消失了!

我认为这是 pylint 中的一个错误,已在版本

之间修复