Skip to content

Commit 04e7dee

Browse files
authored
Add typing to unittest.mock._patch_dict.__call__ (#16310)
* Add overloads to `unittest.mock._patch_dict.__call__` * Simplify _patch_dict.__call__ to single overload _F's bound (Callable[..., Any]) already covers the class and async cases, and generic solving binds to the actual argument type rather than the bound, so the separate _TT/_AF overloads were redundant.
1 parent 050197c commit 04e7dee

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

stdlib/unittest/mock.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ class _patch_dict:
301301
values: Any
302302
clear: Any
303303
def __init__(self, in_dict: Any, values: Any = (), clear: Any = False, **kwargs: Any) -> None: ...
304-
def __call__(self, f: Any) -> Any: ...
304+
def __call__(self, f: _F) -> _F: ...
305305
def __enter__(self) -> Any: ...
306306
def __exit__(self, *args: object) -> Any: ...
307307
def decorate_callable(self, f: _F) -> _F: ...

0 commit comments

Comments
 (0)