pylint
pylint copied to clipboard
False positive on arguments of constructor created by "attrs"
Steps to reproduce
import attr
class Base:
def __init__(self):
pass
@attr.s(auto_attribs=True)
class Sub(Base):
value: int
print(Sub(123))
Current behavior
PyLint reports about the last line:
E1121: Too many positional arguments for constructor call (too-many-function-args)
Expected behavior
No error should be printed, as the generated constructor takes two arguments (self and value).
pylint --version output
pylint 2.4.4
astroid 2.3.3
Python 3.8.2 (default, Mar 05 2020, 18:58:42) [GCC]
Maybe related
Other issues about support for the attrs library are #1698 and #2983. Superficially this issue doesn't seem to be the same thing, but perhaps there is overlap when digging deeper.