mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
merge builtins/2.7/functools.pyi into stdlib/
This commit is contained in:
@@ -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: ...
|
||||
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user