Fix contextlib.ContextDecorator.__call__ types (#4399)

The decorated function returned by ContextDecorator.__call__ has
the same call signature as the original function.

Closes #4382.
This commit is contained in:
Andreas Poehlmann
2020-08-07 02:26:54 +02:00
committed by GitHub
parent de4ea8681d
commit 10a5b070ab

View File

@@ -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: ...