mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-07 05:54:02 +08:00
Fix type for run_coroutine_threadsafe (#13498)
This commit is contained in:
@@ -79,6 +79,7 @@ if sys.version_info >= (3, 12):
|
||||
_FutureLike: TypeAlias = Future[_T] | Awaitable[_T]
|
||||
else:
|
||||
_FutureLike: TypeAlias = Future[_T] | Generator[Any, None, _T] | Awaitable[_T]
|
||||
|
||||
_TaskYieldType: TypeAlias = Future[object] | None
|
||||
|
||||
FIRST_COMPLETED = concurrent.futures.FIRST_COMPLETED
|
||||
@@ -347,7 +348,8 @@ else:
|
||||
*coros_or_futures: _FutureLike[_T], loop: AbstractEventLoop | None = None, return_exceptions: bool
|
||||
) -> Future[list[_T | BaseException]]: ...
|
||||
|
||||
def run_coroutine_threadsafe(coro: _FutureLike[_T], loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ...
|
||||
# unlike some asyncio apis, This does strict runtime checking of actually being a coroutine, not of any future-like.
|
||||
def run_coroutine_threadsafe(coro: Coroutine[Any, Any, _T], loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
def shield(arg: _FutureLike[_T]) -> Future[_T]: ...
|
||||
|
||||
Reference in New Issue
Block a user