mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Use PEP 570 syntax in stdlib (#11250)
This commit is contained in:
@@ -36,9 +36,9 @@ _PWrapper = ParamSpec("_PWrapper")
|
||||
_RWrapper = TypeVar("_RWrapper")
|
||||
|
||||
@overload
|
||||
def reduce(__function: Callable[[_T, _S], _T], __sequence: Iterable[_S], __initial: _T) -> _T: ...
|
||||
def reduce(function: Callable[[_T, _S], _T], sequence: Iterable[_S], initial: _T, /) -> _T: ...
|
||||
@overload
|
||||
def reduce(__function: Callable[[_T, _T], _T], __sequence: Iterable[_T]) -> _T: ...
|
||||
def reduce(function: Callable[[_T, _T], _T], sequence: Iterable[_T], /) -> _T: ...
|
||||
|
||||
class _CacheInfo(NamedTuple):
|
||||
hits: int
|
||||
@@ -61,7 +61,7 @@ class _lru_cache_wrapper(Generic[_T]):
|
||||
def cache_parameters(self) -> _CacheParameters: ...
|
||||
|
||||
def __copy__(self) -> _lru_cache_wrapper[_T]: ...
|
||||
def __deepcopy__(self, __memo: Any) -> _lru_cache_wrapper[_T]: ...
|
||||
def __deepcopy__(self, memo: Any, /) -> _lru_cache_wrapper[_T]: ...
|
||||
|
||||
@overload
|
||||
def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ...
|
||||
@@ -129,8 +129,8 @@ class partial(Generic[_T]):
|
||||
def args(self) -> tuple[Any, ...]: ...
|
||||
@property
|
||||
def keywords(self) -> dict[str, Any]: ...
|
||||
def __new__(cls, __func: Callable[..., _T], *args: Any, **kwargs: Any) -> Self: ...
|
||||
def __call__(__self, *args: Any, **kwargs: Any) -> _T: ...
|
||||
def __new__(cls, func: Callable[..., _T], /, *args: Any, **kwargs: Any) -> Self: ...
|
||||
def __call__(self, /, *args: Any, **kwargs: Any) -> _T: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
@@ -142,9 +142,9 @@ class partialmethod(Generic[_T]):
|
||||
args: tuple[Any, ...]
|
||||
keywords: dict[str, Any]
|
||||
@overload
|
||||
def __init__(self, __func: Callable[..., _T], *args: Any, **keywords: Any) -> None: ...
|
||||
def __init__(self, func: Callable[..., _T], /, *args: Any, **keywords: Any) -> None: ...
|
||||
@overload
|
||||
def __init__(self, __func: _Descriptor, *args: Any, **keywords: Any) -> None: ...
|
||||
def __init__(self, func: _Descriptor, /, *args: Any, **keywords: Any) -> None: ...
|
||||
def __get__(self, obj: Any, cls: type[Any] | None = None) -> Callable[..., _T]: ...
|
||||
@property
|
||||
def __isabstractmethod__(self) -> bool: ...
|
||||
@@ -166,7 +166,7 @@ class _SingleDispatchCallable(Generic[_T]):
|
||||
@overload
|
||||
def register(self, cls: type[Any], func: Callable[..., _T]) -> Callable[..., _T]: ...
|
||||
def _clear_cache(self) -> None: ...
|
||||
def __call__(__self, *args: Any, **kwargs: Any) -> _T: ...
|
||||
def __call__(self, /, *args: Any, **kwargs: Any) -> _T: ...
|
||||
|
||||
def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ...
|
||||
|
||||
@@ -199,7 +199,7 @@ class cached_property(Generic[_T_co]):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
def cache(__user_function: Callable[..., _T]) -> _lru_cache_wrapper[_T]: ...
|
||||
def cache(user_function: Callable[..., _T], /) -> _lru_cache_wrapper[_T]: ...
|
||||
|
||||
def _make_key(
|
||||
args: tuple[Hashable, ...],
|
||||
|
||||
Reference in New Issue
Block a user