diff --git a/stdlib/asyncio/threads.pyi b/stdlib/asyncio/threads.pyi index 3f798d8ac..c13c0c6d1 100644 --- a/stdlib/asyncio/threads.pyi +++ b/stdlib/asyncio/threads.pyi @@ -1,7 +1,9 @@ import sys -from typing import Any, Callable, TypeVar +from typing import Callable, TypeVar +from typing_extensions import ParamSpec -_T = TypeVar("_T") +_P = ParamSpec("_P") +_R = TypeVar("_R") if sys.version_info >= (3, 9): - async def to_thread(__func: Callable[..., _T], *args: Any, **kwargs: Any) -> _T: ... + async def to_thread(__func: Callable[_P, _R], *args: _P.args, **kwargs: _P.kwargs) -> _R: ...