--- /dev/null
+# Stubs for functools (Python 2.7)\r
+\r
+# NOTE: These are incomplete!\r
+\r
+from abc import ABCMeta, abstractmethod\r
+from typing import Any, Callable, Generic, Dict, Iterable, Optional, Sequence, Tuple, TypeVar, overload\r
+from collections import namedtuple\r
+\r
+_AnyCallable = Callable[..., Any]\r
+\r
+_T = TypeVar("_T")\r
+_S = TypeVar("_S")\r
+@overload\r
+def reduce(function: Callable[[_T, _T], _T],\r
+ sequence: Iterable[_T]) -> _T: ...\r
+@overload\r
+def reduce(function: Callable[[_T, _S], _T],\r
+ sequence: Iterable[_S], initial: _T) -> _T: ...\r
+\r
+WRAPPER_ASSIGNMENTS = ... # type: Sequence[str]\r
+WRAPPER_UPDATES = ... # type: Sequence[str]\r
+\r
+def update_wrapper(wrapper: _AnyCallable, wrapped: _AnyCallable, assigned: Sequence[str] = ...,\r
+ updated: Sequence[str] = ...) -> _AnyCallable: ...\r
+def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_AnyCallable], _AnyCallable]: ...\r
+def total_ordering(cls: type) -> type: ...\r
+def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], Any]: ...\r
+\r
+class partial(Generic[_T]):\r
+ func = ... # Callable[..., _T]\r
+ args = ... # type: Tuple[Any, ...]\r
+ keywords = ... # type: Dict[str, Any]\r
+ def __init__(self, func: Callable[..., _T], *args: Any, **kwargs: Any) -> None: ...\r
+ def __call__(self, *args: Any, **kwargs: Any) -> _T: ...\r