From ae86a93f4565ca70a56bcf5c51b9f815710b3810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Gr=C3=BCbel?= Date: Thu, 12 Aug 2021 12:49:30 +0900 Subject: [PATCH] add ParamSpec to atexit (#5896) Co-authored-by: Jelle Zijlstra --- stdlib/atexit.pyi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stdlib/atexit.pyi b/stdlib/atexit.pyi index f068a3ded..9395c6067 100644 --- a/stdlib/atexit.pyi +++ b/stdlib/atexit.pyi @@ -1,7 +1,11 @@ -from typing import Any, Callable +from typing import Any, Callable, TypeVar +from typing_extensions import ParamSpec + +_T = TypeVar("_T") +_P = ParamSpec("_P") def _clear() -> None: ... def _ncallbacks() -> int: ... def _run_exitfuncs() -> None: ... -def register(func: Callable[..., Any], *args: Any, **kwargs: Any) -> Callable[..., Any]: ... +def register(func: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Callable[_P, _T]: ... # type: ignore def unregister(func: Callable[..., Any]) -> None: ...