How to solve Pylint rating issue

Viewed 52

I'm trying to apply the Pylint rules on the following code:

class A:
    

    @staticmethod
    def r():
        

        query = {"get_data": {"$sum": 1)},
                             "value": True}
        

This is giving the result:

a.py:8:0: R0903: Too few public methods (1/2) (too-few-public-methods)

Any thoughts on solving this?

1 Answers

You could rethink / refactor this class but I don't think it's warranted. It's sometime valid to have an API with a single entry-point. You can add a pylint: disable=too-few-public-methods if you think a pylint's message is too opinionated, or even in your pylint configuration file directly to disable for the whole project.

Disclosure : I'm a pylint maintainer, we're probably going to make this check optional because we think it's too opinionated.

Related