From b78eb48b263de3e1bba7cd7e8e44d879975541de Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Sun, 1 Jan 2017 17:24:28 -0800 Subject: [PATCH] Make unittest.removeHandler() an overloaded function. See https://docs.python.org/3/library/unittest.html#unittest.removeHandler - Without args it removes the signal handler. - With a function arg it is a test decorator that temporarily removes the handler while the test is running. --- stdlib/3/unittest/__init__.pyi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stdlib/3/unittest/__init__.pyi b/stdlib/3/unittest/__init__.pyi index 0e074099f..77b79de12 100644 --- a/stdlib/3/unittest/__init__.pyi +++ b/stdlib/3/unittest/__init__.pyi @@ -327,4 +327,7 @@ def main(module: str = ..., defaultTest: _DefaultTestType = ..., def installHandler() -> None: ... def registerResult(result: TestResult) -> None: ... def removeResult(result: TestResult) -> None: ... -def removeHandler(function: Optional[_FT]) -> _FT: ... +@overload +def removeHandler() -> None: ... +@overload +def removeHandler(function: _FT) -> _FT: ...