mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-01 05:30:23 +08:00
Add asyncio.graph, updates to asyncio.futures (3.14) (#14003)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import sys
|
||||
from _asyncio import Future as Future
|
||||
from concurrent.futures._base import Future as _ConcurrentFuture
|
||||
from typing import Any, TypeVar
|
||||
@@ -6,7 +7,10 @@ from typing_extensions import TypeIs
|
||||
from .events import AbstractEventLoop
|
||||
|
||||
# Keep asyncio.__all__ updated with any changes to __all__ here
|
||||
__all__ = ("Future", "wrap_future", "isfuture")
|
||||
if sys.version_info >= (3, 14):
|
||||
__all__ = ("Future", "wrap_future", "isfuture", "future_discard_from_awaited_by", "future_add_to_awaited_by")
|
||||
else:
|
||||
__all__ = ("Future", "wrap_future", "isfuture")
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@@ -15,3 +19,7 @@ _T = TypeVar("_T")
|
||||
# That's why the import order is reversed.
|
||||
def isfuture(obj: object) -> TypeIs[Future[Any]]: ...
|
||||
def wrap_future(future: _ConcurrentFuture[_T] | Future[_T], *, loop: AbstractEventLoop | None = None) -> Future[_T]: ...
|
||||
|
||||
if sys.version_info >= (3, 14):
|
||||
def future_discard_from_awaited_by(future: Future[Any], waiter: Future[Any], /) -> None: ...
|
||||
def future_add_to_awaited_by(future: Future[Any], waiter: Future[Any], /) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user