From c54909ab699cc4a54bcc95be20c628e2fc06dafd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Gr=C3=BCbel?= Date: Fri, 20 Aug 2021 01:32:24 +0900 Subject: [PATCH] Use ParamSpec for unittest.signals.removeHandler() (#5905) --- stdlib/unittest/signals.pyi | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/stdlib/unittest/signals.pyi b/stdlib/unittest/signals.pyi index 5a0a1d622..375b7d736 100644 --- a/stdlib/unittest/signals.pyi +++ b/stdlib/unittest/signals.pyi @@ -1,7 +1,9 @@ import unittest.result -from typing import Any, Callable, TypeVar, overload +from typing import Callable, TypeVar, overload +from typing_extensions import ParamSpec -_F = TypeVar("_F", bound=Callable[..., Any]) +_P = ParamSpec("_P") +_T = TypeVar("_T") def installHandler() -> None: ... def registerResult(result: unittest.result.TestResult) -> None: ... @@ -9,4 +11,4 @@ def removeResult(result: unittest.result.TestResult) -> bool: ... @overload def removeHandler(method: None = ...) -> None: ... @overload -def removeHandler(method: _F) -> _F: ... +def removeHandler(method: Callable[_P, _T]) -> Callable[_P, _T]: ... # type: ignore