merge builtins/2.7/functools.pyi into stdlib/

This commit is contained in:
Matthias Kramm
2015-09-30 12:22:30 -07:00
parent 43876def56
commit 9ab5976585
2 changed files with 9 additions and 15 deletions

View File

@@ -1,12 +0,0 @@
from typing import Any, Callable
_T = TypeVar("T")
def reduce(function: Callable[[_T], _T],
sequence: Iterator[_T], initial=Optional[_T]) -> _T: ...
class partial(object):
func = ... # Callable[..., Any]
args = ... # type: Tuple[Any]
keywords = ... # type: Dict[str, Any]
def __init__(self, func: Callable[..., Any], *args, **kwargs) -> None: ...
def __call__(self, *args, **kwargs) -> Any: ...

View File

@@ -8,7 +8,9 @@ from collections import namedtuple
_AnyCallable = Callable[..., Any]
def reduce(function, iterable, initializer=None): ...
_T = TypeVar("T")
def reduce(function: Callable[[_T], _T],
sequence: Iterator[_T], initial=Optional[_T]) -> _T: ...
WRAPPER_ASSIGNMENTS = ... # type: Sequence[str]
WRAPPER_UPDATES = ... # type: Sequence[str]
@@ -19,5 +21,9 @@ def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequenc
def total_ordering(cls: type) -> type: ...
def cmp_to_key(mycmp): ...
# TODO: give a more specific return type for partial (a callable object with some attributes).
def partial(func: _AnyCallable, *args, **keywords) -> Any: ...
class partial(object):
func = ... # Callable[..., Any]
args = ... # type: Tuple[Any]
keywords = ... # type: Dict[str, Any]
def __init__(self, func: Callable[..., Any], *args, **kwargs) -> None: ...
def __call__(self, *args, **kwargs) -> Any: ...