diff --git a/stdlib/unittest/mock.pyi b/stdlib/unittest/mock.pyi index 7ccaf3aca..f22deb944 100644 --- a/stdlib/unittest/mock.pyi +++ b/stdlib/unittest/mock.pyi @@ -1,7 +1,6 @@ import sys from typing import Any, Callable, Generic, Iterable, List, Mapping, Sequence, Tuple, Type, TypeVar, overload -_F = TypeVar("_F", bound=Callable[..., Any]) _T = TypeVar("_T") _TT = TypeVar("_TT", bound=Type[Any]) _R = TypeVar("_R") @@ -176,9 +175,12 @@ class _patch(Generic[_T]): kwargs: Mapping[str, Any], ) -> None: ... def copy(self) -> _patch[_T]: ... + @overload + def __call__(self, func: _TT) -> _TT: ... + @overload def __call__(self, func: Callable[..., _R]) -> Callable[..., _R]: ... def decorate_class(self, klass: _TT) -> _TT: ... - def decorate_callable(self, func: _F) -> _F: ... + def decorate_callable(self, func: Callable[..., _R]) -> Callable[..., _R]: ... def get_original(self) -> Tuple[Any, bool]: ... target: Any temp_original: Any