如何解决皮层评级问题
我试图在以下代码上应用pylint规则:
class A:
@staticmethod
def r():
query = {"get_data": {"$sum": 1)},
"value": True}
这给出了结果:
a.py:8:0: R0903: Too few public methods (1/2) (too-few-public-methods)
解决此问题的任何想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以重新考虑 /重构本班,但我认为这是不需要的。
拥有一个带有单个入口点的API是有时有效的。您可以添加
pylint:disable = Too-Few-public方法
,如果您认为Pylint的消息过于有用,甚至直接在Pylint配置文件中直接禁用整个项目。披露:我是一名皮革维护者,我们可能会使此支票可选,因为我们认为它太有用了。
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.