Skip to content

Commit e735438

Browse files
Add comment.
1 parent e054f40 commit e735438

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

astroid/inference_tip.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,15 @@ def inner(*args: _P.args, **kwargs: _P.kwargs) -> Iterator[InferenceResult]:
4141
if partial_cache_key in _CURRENTLY_INFERRING:
4242
# If through recursion we end up trying to infer the same
4343
# func + node we raise here.
44-
raise UseInferenceDefault()
44+
raise UseInferenceDefault
4545
try:
4646
return _cache[func, node, context]
4747
except KeyError:
4848
# Recursion guard with a partial cache key.
49+
# Using the full key causes a recursion error on PyPy.
50+
# It's a pragmatic compromise to avoid so much recursive inference
51+
# with slightly different contexts while still passing the simple
52+
# test cases included with this commit.
4953
_CURRENTLY_INFERRING.add(partial_cache_key)
5054
result = _cache[func, node, context] = list(func(*args, **kwargs))
5155
assert result

0 commit comments

Comments
 (0)