小编mug*_*ump的帖子

Pylint警告"无用的超级代表团"

Pylint提出警告:Useless super delegation in method '__init__' (useless-super-delegation)对于SpecificError下面的课程.

class MyProjectExceptions(Exception):
    """The base class for all my project's exceptions."""
    def __init__(self, message, func):
        super(MyProjectExceptions, self).__init__(message)  # Normal exception handling
        self.func = func  # Error origin for logging

class SpecificError(MyProjectExceptions):
    """Raise when a specific error occurs."""
    def __init__(self, message, func):
        super(SpecificError, self).__init__(message, func)
Run Code Online (Sandbox Code Playgroud)

在这里将参数传递给超类的正确方法是什么?

python pylint super python-2.7

7
推荐指数
2
解决办法
3843
查看次数

标签 统计

pylint ×1

python ×1

python-2.7 ×1

super ×1