mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
add ParamSpec to asyncio.to_thread (#6668)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user