We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c420fea commit 3df22deCopy full SHA for 3df22de
cmk/utils/caching.py
@@ -26,10 +26,7 @@ def instance_method_lru_cache(
26
def wrap(f: Callable[P, R]) -> Callable[P, R]:
27
@wraps(f)
28
def wrapped_f(*args: P.args, **kwargs: P.kwargs) -> R:
29
- # We can use the following when https://github.com/python/mypy/pull/13459 is release (mypy 0.980)
30
- # self, *rest = args
31
- self = args[0]
32
- rest = args[1:]
+ self, *rest = args
33
cache_orig = lru_cache(maxsize, typed)(f)
34
instance_cache = cache_orig.__get__(self, self.__class__) # type: ignore[attr-defined] # pylint: disable=unnecessary-dunder-call
35
setattr(self, f.__name__, instance_cache)
0 commit comments