What makes pylint think my class is abstract?

前端 未结 2 705
情话喂你
情话喂你 2021-01-18 16:21

As I understand it, Python (2.5.2) does not have real support for abstract classes. Why is pylint complaining about this class being an \"Abstract class not reference?\" Wil

相关标签:
2条回答
  • 2021-01-18 16:48

    In my experience, pylint is a bit over-zealous, and isn't useful until you've turned off a number of the warnings.

    0 讨论(0)
  • 2021-01-18 16:52

    FWIW, raising NotImplementedError is enough to make pylint think this is an abstract class (which is absolutely correct). from logilab.org/card/pylintfeatures: W0223: Method %r is abstract in class %r but is not overridden Used when an abstract method (ie raise NotImplementedError) is not overridden in concrete class. – Tobiesque 2 hours ago

    0 讨论(0)
提交回复
热议问题