-
-
Notifications
You must be signed in to change notification settings - Fork 273
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 RecursionError in infer_call_result()
#2432
Conversation
Codecov ReportAll modified and coverable lines are covered by tests β
Additional details and impacted files@@ Coverage Diff @@
## main #2432 +/- ##
=======================================
Coverage 92.78% 92.78%
=======================================
Files 94 94
Lines 11098 11102 +4
=======================================
+ Hits 10297 10301 +4
Misses 801 801
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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 see nothing wrong here, but I would lie if I say I understand what was happening here :D would you mind explaining (very slowly) ?
Of course! I noticed that the recursion error reports in pylint seemed to have a line from I edited the test to show this more clearly. Inferring the result of If you comment out the code change and run the test, you'll see the recursive calls in the pytest output: astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context):
astroid/bases.py:334: in infer_call_result
for res in node.infer_call_result(caller, context): The point of the patch is to notice that the two things being checked are the same class and bail out. |
(The |
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 explaining, make sense !
(Sorry forgot to approve) |
(cherry picked from commit d1c37a9)
(cherry picked from commit d1c37a9) Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
Type of Changes
Description
Closes pylint-dev/pylint#9139