R0923

Message

Interface not implemented

Description

Used when an interface class has not been implemented.

Explanation

PyLint infers that a class is an interface class from two circumstances: If the class name ends with Interface (? Is that really the rule ?), it is considered an interface class, and/or if the class inherits from an interface class, it is considered an interface class. Note that the rule described in PyLint FAQ 5.1 only describes the second part and misses to describe the first part.

PyLint uses the Zope 2 convention for recognizing whether an interface class has been implemented: The class implementing an interface class specifies the implemented interface class in its class attribute __implements__ (see PyLint FAQ 5.2).

PyLint raises this message for interface classes that are defined in a module and have not been implemented in that module. (? Is that really the rule ?)

Note, there are currently two issues with this message:

  1. Inferring that any class that inherits from an interface class is also an interface class is suboptimal. See PyLint Issue #346.
  2. If the rule stated above is correct, then requiring that an interface class must be implemented in the same module is suboptimal.

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License