R0903 too-few-public-methods

Message

'Too few public methods (%s/%s)'

Description

Used when class has too few public methods, so be sure it’s really worth it.

Example

class SomeClass:
    pass
1:0: R0903: Too few public methods (0/2)

Why bother?

From a (pure) object-oriented programming perspective, a class (and its instances) shall bundle data (the object’s attributes) and behaviour (its methods). If a class does not expose any public methods, this rule is violated. There are good reasons for classes without public methods. But if many of your classes have this get this warning, you should re-think them.

Running Pylint locally? In your CI?

There is a better way! Run PyCodeQual & get Pylint findings with history, diffs and statistics.

Click here to find out more.