Skip to content

Commit 97a4b19

Browse files
authored
Merge 39c1118 into e1eacb1
2 parents e1eacb1 + 39c1118 commit 97a4b19

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎crates/ty_vendored/vendor/typeshed/stdlib/functools.pyi‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ from collections.abc import Callable, Hashable, Iterable, Sized
77
from types import GenericAlias
88
from typing import (
99
Any,
10+
Concatenate,
1011
Final,
1112
Generic,
1213
Literal,
@@ -45,6 +46,8 @@ _PWrapped = ParamSpec("_PWrapped")
4546
_RWrapped = TypeVar("_RWrapped")
4647
_PWrapper = ParamSpec("_PWrapper")
4748
_RWrapper = TypeVar("_RWrapper")
49+
_WrapperSelfT = TypeVar("_WrapperSelfT")
50+
_PBound = ParamSpec("_PBound")
4851

4952
if sys.version_info >= (3, 14):
5053
@overload
@@ -190,10 +193,17 @@ WRAPPER_UPDATES: Final[tuple[Literal["__dict__"]]]
190193
class _Wrapped(Generic[_PWrapped, _RWrapped, _PWrapper, _RWrapper]):
191194
__wrapped__: Callable[_PWrapped, _RWrapped]
192195
def __call__(self, *args: _PWrapper.args, **kwargs: _PWrapper.kwargs) -> _RWrapper: ...
193-
# as with ``Callable``, we'll assume that these attributes exist
196+
# as with ``Callable``, we'll assume that these attributes/methods exist
194197
__name__: str
195198
__qualname__: str
196199

200+
@overload
201+
def __get__(self, instance: None, owner: type, /) -> Self: ...
202+
@overload
203+
def __get__(
204+
self: Callable[Concatenate[_WrapperSelfT, _PBound], _RWrapper], instance: _WrapperSelfT, owner: type | None = None, /
205+
) -> Callable[_PBound, _RWrapper]: ...
206+
197207
@type_check_only
198208
class _Wrapper(Generic[_PWrapped, _RWrapped]):
199209
def __call__(self, f: Callable[_PWrapper, _RWrapper]) -> _Wrapped[_PWrapped, _RWrapped, _PWrapper, _RWrapper]: ...

0 commit comments

Comments
 (0)