-
-
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
Fix a false positive for no-member
.
#8778
Fix a false positive for no-member
.
#8778
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #8778 +/- ##
=======================================
Coverage 95.75% 95.76%
=======================================
Files 173 173
Lines 18604 18604
=======================================
+ Hits 17815 17816 +1
+ Misses 789 788 -1
|
This comment has been minimized.
This comment has been minimized.
b546d7d
to
7a8d743
Compare
This comment has been minimized.
This comment has been minimized.
7a8d743
to
5bad8d2
Compare
This comment has been minimized.
This comment has been minimized.
5bad8d2
to
4530e50
Compare
This comment has been minimized.
This comment has been minimized.
4530e50
to
1e43834
Compare
π€ According to the primer, this change has no effect on the checked open source code. π€π This comment was generated for commit 1e43834 |
Is it still a draft @mbyrnepr2 ? |
Thanks for the reminder @Pierre-Sassoulas. Itβs been a while since I thought about it and I think I must have had a doubt about it to leave it as a draft. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to do something specific to pydantic(s Base Model to treat it correctly erven if it's dynamic (maybe a brain in astroid, maybe an external plugin) but I'm not a pydantic user so I don't know exactly how BaseModel is supposed to behave.
obj_a = A() | ||
obj_a.value += 1 # [no-member] | ||
obj_a.value += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A review comment got lost: Here we'd introduce a false negative, running the code raise an error:
Traceback (most recent call last):
File "/home/pierre/pylint/doc/a.py", line 12, in <module>
obj_a = A(1)
TypeError: A() takes no arguments
β¦ibute that is annotated in a class body. Closes pylint-dev#8759
1e43834
to
f056878
Compare
Type of Changes
Description
Fix a false positive for
no-member
when accessing a no-value attribute that is annotated in a class body.Closes #8759