2 from typing import Any, Callable, Generic, Dict, Iterable, Mapping, Optional, Sequence, Tuple, Type, TypeVar, NamedTuple, Union, overload
\r
4 _AnyCallable = Callable[..., Any]
\r
9 def reduce(function: Callable[[_T, _S], _T],
\r
10 sequence: Iterable[_S], initial: _T) -> _T: ...
\r
12 def reduce(function: Callable[[_T, _T], _T],
\r
13 sequence: Iterable[_T]) -> _T: ...
\r
16 class _CacheInfo(NamedTuple('CacheInfo', [
\r
23 class _lru_cache_wrapper(Generic[_T]):
\r
24 __wrapped__ = ... # type: Callable[..., _T]
\r
25 def __call__(self, *args: Any, **kwargs: Any) -> _T: ...
\r
26 def cache_info(self) -> _CacheInfo: ...
\r
27 def cache_clear(self) -> None: ...
\r
30 def __init__(self, maxsize: Optional[int] = ..., typed: bool = ...) -> None: ...
\r
31 def __call__(self, f: Callable[..., _T]) -> _lru_cache_wrapper[_T]: ...
\r
34 WRAPPER_ASSIGNMENTS = ... # type: Sequence[str]
\r
35 WRAPPER_UPDATES = ... # type: Sequence[str]
\r
37 def update_wrapper(wrapper: _AnyCallable, wrapped: _AnyCallable, assigned: Sequence[str] = ...,
\r
38 updated: Sequence[str] = ...) -> _AnyCallable: ...
\r
39 def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_AnyCallable], _AnyCallable]: ...
\r
40 def total_ordering(cls: type) -> type: ...
\r
41 def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], Any]: ...
\r
43 class partial(Generic[_T]):
\r
44 func = ... # type: Callable[..., _T]
\r
45 args = ... # type: Tuple[Any, ...]
\r
46 keywords = ... # type: Dict[str, Any]
\r
47 def __init__(self, func: Callable[..., _T], *args: Any, **kwargs: Any) -> None: ...
\r
48 def __call__(self, *args: Any, **kwargs: Any) -> _T: ...
\r
50 # With protocols, this could change into a generic protocol that defines __get__ and returns _T
\r
53 class partialmethod(Generic[_T]):
\r
54 func: Union[Callable[..., _T], _Descriptor]
\r
55 args: Tuple[Any, ...]
\r
56 keywords: Dict[str, Any]
\r
59 def __init__(self, func: Callable[..., _T], *args: Any, **keywords: Any) -> None: ...
\r
61 def __init__(self, func: _Descriptor, *args: Any, **keywords: Any) -> None: ...
\r
62 def __get__(self, obj: Any, cls: Type[Any]) -> Callable[..., _T]: ...
\r
64 def __isabstractmethod__(self) -> bool: ...
\r
66 class _SingleDispatchCallable(Generic[_T]):
\r
67 registry = ... # type: Mapping[Any, Callable[..., _T]]
\r
68 def dispatch(self, cls: Any) -> Callable[..., _T]: ...
\r
70 def register(self, cls: Any) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ...
\r
72 def register(self, cls: Any, func: Callable[..., _T]) -> Callable[..., _T]: ...
\r
73 def _clear_cache(self) -> None: ...
\r
74 def __call__(self, *args: Any, **kwargs: Any) -> _T: ...
\r
76 def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ...
\r