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

标签 python python-2.7 pylint

我的类(class)是这样组织的:

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,它太旧了,也许这就是原因?

最佳答案

事实证明,我的 pylint 版本已经严重过时了。我正在运行版本 1.1.0,并更新到最新版本 1.6.4,警告消失了!

我认为这是 pylint 中的一个错误,已在不同版本之间修复

关于python - "E1101"- "Class"的实例没有 "method"成员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39008121/

相关文章:

Python pylint(raise-format-tuple) 异常参数表明字符串格式可能是有意的

CMake - 检查是否安装了 Pylint

python - 如何检查数组是否为空?

django - 国家 : A list of their state/province and cities list

python - PyLint 消息 : logging-format-interpolation

python - 按值对多维字典进行排序并在 Python 中返回新排序的字典

python - 如何将 float 转换为十六进制

Python使用pandas将numpy数组插入sqlite3数据库

python - Keras 进度条显示什么?

python - 绘图 python 显示空值