-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False positive Instance of '_CountingAttr' has no 'append' member
with attrs
#7884
Comments
Instance of '_CountingAttr' has no 'append' member
with attrs
This seems to be originating from the way astroid detects if a class is decorated by attrs see. This means that it will not detect attrs when using it as is shown in the official docs . So - by changing your code to use
|
I opened a PR with a POC to improve the way that astroid detects attrs, |
@Pierre-Sassoulas Which should way should we go here?
|
I'm not super up to date on this issue, but creating/upgrading an astroid brain is almost always the easy way to fix things, so I would say your MR. |
Changelog: ========= * Support more possible usages of "attrs" decorators. Closes pylint-dev/pylint#7884 Signed-off-by: Wang Mingyu <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Changelog: ========= * Support more possible usages of "attrs" decorators. Closes pylint-dev/pylint#7884 Signed-off-by: Wang Mingyu <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Bug description
Pylint is generating warnings on dataclasses defined with attrs.
In particular on lists annotated with
field
, e.g.values: list[str] = field(factory=list)
.With
a.py
equal toCommand used
Pylint output
Expected behavior
No pylint errors
Pylint version
The text was updated successfully, but these errors were encountered: