Skip to content

Commit 30af935

Browse files
author
Guido van Rossum
committed
Make partial a generic type (the parameter being the return type).
1 parent cea5060 commit 30af935

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

stdlib/2.7/functools.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# NOTE: This dynamically typed stub was automatically generated by stubgen.
44

55
from abc import ABCMeta, abstractmethod
6-
from typing import Any, Callable, Dict, Iterator, Optional, Sequence, Tuple, TypeVar
6+
from typing import Any, Callable, Generic, Dict, Iterator, Optional, Sequence, Tuple, TypeVar
77
from collections import namedtuple
88

99
_AnyCallable = Callable[..., Any]
@@ -21,9 +21,9 @@ def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequenc
2121
def total_ordering(cls: type) -> type: ...
2222
def cmp_to_key(mycmp: Callable[[_T, _T], bool]) -> Callable[[_T], Any]: ...
2323

24-
class partial(object):
25-
func = ... # Callable[..., Any]
24+
class partial(Generic[_T]):
25+
func = ... # Callable[..., _T]
2626
args = ... # type: Tuple[Any, ...]
2727
keywords = ... # type: Dict[str, Any]
28-
def __init__(self, func: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ...
29-
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
28+
def __init__(self, func: Callable[..., _T], *args: Any, **kwargs: Any) -> None: ...
29+
def __call__(self, *args: Any, **kwargs: Any) -> _T: ...

0 commit comments

Comments
 (0)