python - Pylint W0223 : Method . ..在类中是抽象的...但未被覆盖

标签 python pylint

Pylint 为抽象类的子类生成此错误,即使这些子类本身未实例化并且方法在具体子类中覆盖。为什么 Pylint 认为我的抽象子类应该是具体的?如何在不拿出锤子并在 rc 文件中完全禁用它的情况下关闭此警告?

最佳答案

出于某种原因,pylint 认为该类不是抽象的(当前检测是通过检查引发 NotImplementedError 的方法来完成的)。在模块(仅在该模块中禁用)或类(仅在该类中)的顶部添加像 #pylint: disable=W0223 这样的注释应该可以解决问题。

关于python - Pylint W0223 : Method . ..在类中是抽象的...但未被覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22186843/

相关文章:

python - 将curl 转换为Python 请求(post)

python - Django 正则表达式 unicode 忽略\w 标签

python - 类方法中的 protected 属性

python - 如何使 pylint 报告未使用的返回值

python - 在 Visual Studio Code 中使用来自 WSL(Windows 的 Ubuntu)的 linter

python - VSCode PyLint 未检测到我的 Python DTO 类成员

python - 滚动面板鼠标滚轮滚动

java - 将数组从 Java 返回到 Python

python - Pylint - 区分新旧错误

Python:为边缘检测设置一个带有序列错误的数组元素