[functools] Allow method override with @cache decorator (#15238)

This commit is contained in:
Emmanuel Ferdman
2026-01-09 17:18:58 +02:00
committed by GitHub
parent 63ea326f8c
commit f30821cf01
2 changed files with 18 additions and 6 deletions
+5 -5
View File
@@ -54,14 +54,14 @@ class _CacheParameters(TypedDict):
typed: bool
@final
class _lru_cache_wrapper(Generic[_T]):
__wrapped__: Callable[..., _T]
def __call__(self, *args: Hashable, **kwargs: Hashable) -> _T: ...
class _lru_cache_wrapper(Generic[_T_co]):
__wrapped__: Callable[..., _T_co]
def __call__(self, *args: Hashable, **kwargs: Hashable) -> _T_co: ...
def cache_info(self) -> _CacheInfo: ...
def cache_clear(self) -> None: ...
def cache_parameters(self) -> _CacheParameters: ...
def __copy__(self) -> _lru_cache_wrapper[_T]: ...
def __deepcopy__(self, memo: Any, /) -> _lru_cache_wrapper[_T]: ...
def __copy__(self) -> _lru_cache_wrapper[_T_co]: ...
def __deepcopy__(self, memo: Any, /) -> _lru_cache_wrapper[_T_co]: ...
@overload
def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ...