-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Make igetattr()
idempotent
#2208
Make igetattr()
idempotent
#2208
Conversation
This addresses some reports of varying results when running pylint with ``--jobs. The original inconsistency was due to a performance optimization in 2d7a87b, but we have no source for the original bug report it targeted.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2208 +/- ##
=======================================
Coverage 92.68% 92.68%
=======================================
Files 94 94
Lines 10820 10828 +8
=======================================
+ Hits 10028 10036 +8
Misses 792 792
Flags with carried forward coverage won't be shown. Click here to find out more.
|
It seems like the original reason to do that was for performance. Did you check the performance or just the tests suite result when testing in pylint ? (We're probably going to merge anyway as correctness is more important than performance especially if we can't parralelize without fixing this.. but is it really bad ?) |
Right, but only for the pathological case where there are self-references created like in #7 (comment). So I wouldn't expect much of a performance impact.
Just the test suite, and then also trying to reproduce the original pathological case, but couldn't. I just now linted a couple packages and there was no significant difference in the total time. |
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.
Thank you for checking !
Thanks for the review! |
Type of Changes
Description
See regression test. The second time an instance's attribute is inferred with the same context (which pylint has legitimate use cases for, see existing test that was improved!), we still need to be able to get a successful inference result. Instead, we were getting Uninferable due to a performance optimization added in 2d7a87b.
This addresses some reports of varying results when running pylint with
--jobs
.Closes pylint-dev/pylint#4356
Refs #7
More info
The original inconsistency added in 2d7a87b targeted a report in #7, but we have no source for the original code being tested.
I attempted to guess what the bug report in #7 was. I came up with the following based on #7 (comment), and it lints fine:
I don't want to commit this file to the tests, though, because it's a wild guess.