Skip to content

Commit 33b6c56

Browse files
Revert "Add a bound to the inference tips cache (#1565)" (#1570)
This reverts commit 95bbd5e.
1 parent cc37d58 commit 33b6c56

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

ChangeLog

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ Release date: TBA
2424

2525
Refs PyCQA/pylint#5113
2626

27-
* Add a bound to the inference tips cache.
28-
29-
Closes #1150
30-
3127
* Infer the return value of the ``.copy()`` method on ``dict``, ``list``, ``set``,
3228
and ``frozenset``.
3329

astroid/inference_tip.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from __future__ import annotations
88

99
import typing
10-
from collections import OrderedDict
1110
from collections.abc import Iterator
1211

1312
import wrapt
@@ -21,7 +20,7 @@
2120
NodeNG, bases.Instance, bases.UnboundMethod, typing.Type[util.Uninferable]
2221
]
2322

24-
_cache: OrderedDict[tuple[InferFn, NodeNG], list[InferOptions] | None] = OrderedDict()
23+
_cache: dict[tuple[InferFn, NodeNG], list[InferOptions] | None] = {}
2524

2625

2726
def clear_inference_tip_cache():
@@ -37,14 +36,11 @@ def _inference_tip_cached(
3736
node = args[0]
3837
try:
3938
result = _cache[func, node]
40-
_cache.move_to_end((func, node))
4139
# If through recursion we end up trying to infer the same
4240
# func + node we raise here.
4341
if result is None:
4442
raise UseInferenceDefault()
4543
except KeyError:
46-
if len(_cache) > 127:
47-
_cache.popitem(last=False)
4844
_cache[func, node] = None
4945
result = _cache[func, node] = list(func(*args, **kwargs))
5046
assert result

0 commit comments

Comments
 (0)