Skip to content

Commit 89e9326

Browse files
committed
implement suggested change from WMOkiishi
1 parent e591a5b commit 89e9326

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

‎stdlib/functools.pyi‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ if sys.version_info >= (3, 9):
3131
_T = TypeVar("_T")
3232
_S = TypeVar("_S")
3333
_P = ParamSpec("_P")
34+
_Q = ParamSpec("_Q")
3435

3536
_PWrapped = ParamSpec("_PWrapped")
3637
_RWrapped = TypeVar("_RWrapped")
@@ -66,14 +67,22 @@ class _lru_cache_wrapper(Generic[_P, _T]):
6667
def __deepcopy__(self, __memo: Any) -> _lru_cache_wrapper[_P, _T]: ...
6768
if sys.version_info >= (3, 8):
6869
@overload
69-
def __get__(self, __instance: None, __owner: type[_S] | None = ...) -> _lru_cache_wrapper[_P, _T]: ...
70+
def __get__(
71+
self: _lru_cache_wrapper[Concatenate[_S, _Q], _T], __instance: None, __owner: type[_S] | None = ...
72+
) -> Callable[_Q, _T]: ...
7073
@overload
71-
def __get__(self, __instance: _S, __owner: type[_S] | None = ...) -> Callable[Concatenate[_S, _P], _T]: ...
74+
def __get__(
75+
self: _lru_cache_wrapper[Concatenate[_S, _Q], _T], __instance: _S, __owner: type[_S] | None = ...
76+
) -> Callable[_Q, _T]: ...
7277
else:
7378
@overload
74-
def __get__(self, __instance: None, __owner: type[_S] | None) -> _lru_cache_wrapper[_P, _T]: ...
79+
def __get__(
80+
self: _lru_cache_wrapper[Concatenate[_S, _Q], _T], __instance: None, __owner: type[_S] | None
81+
) -> Callable[_Q, _T]: ...
7582
@overload
76-
def __get__(self, __instance: _S, __owner: type[_S] | None) -> Callable[Concatenate[_S, _P], _T]: ...
83+
def __get__(
84+
self: _lru_cache_wrapper[Concatenate[_S, _Q], _T], __instance: _S, __owner: type[_S] | None
85+
) -> Callable[_Q, _T]: ...
7786

7887
if sys.version_info >= (3, 8):
7988
@overload

0 commit comments

Comments
 (0)