Skip to content

add ParamSpec to asyncio.to_thread #6668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 23, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions stdlib/asyncio/threads.pyi
Original file line number Diff line number Diff line change
@@ -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: ...