相关疑难解决方法(0)

Pylint:可以从统计中排除继承的公共方法吗?

Pylint不断报告R: 73,0:MyLogging: Too many public methods (22/20)以下代码的error():

class MyLogging(logging.Logger):
    def foo(self):
        pass
    def bar(self):
        pass
Run Code Online (Sandbox Code Playgroud)

起初我认为这是Pylint中的一个错误,因为MyLogging类只有22行代码,但是我意识到,它包括了基类中的所有公共方法logging.Logger,这增加了20个统计数据.

您知道是否可以从Pylint统计中排除基类公共方法?

PS.我知道我可以更改max-public-methods为更高的数字,或者添加一次异常# pylint: disable=R0904

python pylint

9
推荐指数
1
解决办法
2340
查看次数

标签 统计

pylint ×1

python ×1