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)
在这里将参数传递给超类的正确方法是什么?