massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 2 / functools.pyi
1 # Stubs for functools (Python 2.7)\r
2 \r
3 # NOTE: These are incomplete!\r
4 \r
5 from abc import ABCMeta, abstractmethod\r
6 from typing import Any, Callable, Generic, Dict, Iterable, Optional, Sequence, Tuple, TypeVar, overload\r
7 from collections import namedtuple\r
8 \r
9 _AnyCallable = Callable[..., Any]\r
10 \r
11 _T = TypeVar("_T")\r
12 _S = TypeVar("_S")\r
13 @overload\r
14 def reduce(function: Callable[[_T, _T], _T],\r
15            sequence: Iterable[_T]) -> _T: ...\r
16 @overload\r
17 def reduce(function: Callable[[_T, _S], _T],\r
18            sequence: Iterable[_S], initial: _T) -> _T: ...\r
19 \r
20 WRAPPER_ASSIGNMENTS = ...  # type: Sequence[str]\r
21 WRAPPER_UPDATES = ...  # type: Sequence[str]\r
22 \r
23 def update_wrapper(wrapper: _AnyCallable, wrapped: _AnyCallable, assigned: Sequence[str] = ...,\r
24                    updated: Sequence[str] = ...) -> _AnyCallable: ...\r
25 def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_AnyCallable], _AnyCallable]: ...\r
26 def total_ordering(cls: type) -> type: ...\r
27 def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], Any]: ...\r
28 \r
29 class partial(Generic[_T]):\r
30     func = ...  # Callable[..., _T]\r
31     args = ...  # type: Tuple[Any, ...]\r
32     keywords = ...  # type: Dict[str, Any]\r
33     def __init__(self, func: Callable[..., _T], *args: Any, **kwargs: Any) -> None: ...\r
34     def __call__(self, *args: Any, **kwargs: Any) -> _T: ...\r