diff --git a/stdlib/functools.pyi b/stdlib/functools.pyi index 828a9d241ab0..58e01d04c05e 100644 --- a/stdlib/functools.pyi +++ b/stdlib/functools.pyi @@ -31,6 +31,7 @@ if sys.version_info >= (3, 9): _T = TypeVar("_T") _S = TypeVar("_S") _P = ParamSpec("_P") +_Q = ParamSpec("_Q") _PWrapped = ParamSpec("_PWrapped") _RWrapped = TypeVar("_RWrapped") @@ -66,14 +67,22 @@ class _lru_cache_wrapper(Generic[_P, _T]): def __deepcopy__(self, __memo: Any) -> _lru_cache_wrapper[_P, _T]: ... if sys.version_info >= (3, 8): @overload - def __get__(self, __instance: None, __owner: type[_S] | None = ...) -> _lru_cache_wrapper[_P, _T]: ... + def __get__( + self: _lru_cache_wrapper[Concatenate[_S, _Q], _T], __instance: None, __owner: type[_S] | None = ... + ) -> Callable[_Q, _T]: ... @overload - def __get__(self, __instance: _S, __owner: type[_S] | None = ...) -> Callable[Concatenate[_S, _P], _T]: ... + def __get__( + self: _lru_cache_wrapper[Concatenate[_S, _Q], _T], __instance: _S, __owner: type[_S] | None = ... + ) -> Callable[_Q, _T]: ... else: @overload - def __get__(self, __instance: None, __owner: type[_S] | None) -> _lru_cache_wrapper[_P, _T]: ... + def __get__( + self: _lru_cache_wrapper[Concatenate[_S, _Q], _T], __instance: None, __owner: type[_S] | None + ) -> Callable[_Q, _T]: ... @overload - def __get__(self, __instance: _S, __owner: type[_S] | None) -> Callable[Concatenate[_S, _P], _T]: ... + def __get__( + self: _lru_cache_wrapper[Concatenate[_S, _Q], _T], __instance: _S, __owner: type[_S] | None + ) -> Callable[_Q, _T]: ... if sys.version_info >= (3, 8): @overload