Skip to content

Commit eced701

Browse files
add ParamSpec to asyncio.to_thread (#6668)
Co-authored-by: Jelle Zijlstra <[email protected]>
1 parent aa329b2 commit eced701

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

stdlib/asyncio/threads.pyi

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import sys
2-
from typing import Any, Callable, TypeVar
2+
from typing import Callable, TypeVar
3+
from typing_extensions import ParamSpec
34

4-
_T = TypeVar("_T")
5+
_P = ParamSpec("_P")
6+
_R = TypeVar("_R")
57

68
if sys.version_info >= (3, 9):
7-
async def to_thread(__func: Callable[..., _T], *args: Any, **kwargs: Any) -> _T: ...
9+
async def to_thread(__func: Callable[_P, _R], *args: _P.args, **kwargs: _P.kwargs) -> _R: ...

0 commit comments

Comments
 (0)