You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromattrsimportdefine, field@define(auto_exc=False, init=False)classBaseError(Exception):
v: int=field(default=0, kw_only=True)
def__init__(self, msg=None, *, v=None):
super().__init__(msg)
self.__attrs_init__(v=vor0)
# Pylint will raise false positive warnings for derived classes,# when __init__ is defined directly. Monkey-patching resolves the problem:# setattr(BaseError, '__init__', BaseError._my__init__)@define(auto_exc=False)classError1(BaseError):
x: inty: intprint(Error1(1, 2)) # << here
pylint pylint_example.py
************* Module pylint_example
pylint_example.py:20:6: E1121: Too many positional arguments for constructor call (too-many-function-args)
Attrs 21.4.0, pylint 2.10.2. But it happened in earlier versions too.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
pylint pylint_example.py
************* Module pylint_example
pylint_example.py:20:6: E1121: Too many positional arguments for constructor call (too-many-function-args)
Attrs 21.4.0, pylint 2.10.2. But it happened in earlier versions too.
The text was updated successfully, but these errors were encountered: