From 10a5b070ab29458ce9306fd67883af56d912f174 Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Fri, 7 Aug 2020 02:26:54 +0200 Subject: [PATCH] Fix contextlib.ContextDecorator.__call__ types (#4399) The decorated function returned by ContextDecorator.__call__ has the same call signature as the original function. Closes #4382. --- stdlib/2and3/contextlib.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/2and3/contextlib.pyi b/stdlib/2and3/contextlib.pyi index 404c7f0a3..c747ab547 100644 --- a/stdlib/2and3/contextlib.pyi +++ b/stdlib/2and3/contextlib.pyi @@ -64,7 +64,7 @@ if sys.version_info >= (3, 5): if sys.version_info >= (3,): class ContextDecorator: - def __call__(self, func: Callable[..., None]) -> Callable[..., ContextManager[None]]: ... + def __call__(self, func: _F) -> _F: ... _U = TypeVar("_U", bound=ExitStack) class ExitStack(ContextManager[ExitStack]): def __init__(self) -> None: ...