mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Sync asyncio.isfuture definitions by sharing asyncio.base_futures.isfuture definition (#7353)
This commit is contained in:
@@ -2,6 +2,7 @@ import sys
|
||||
from _typeshed import Self
|
||||
from concurrent.futures._base import Error, Future as _ConcurrentFuture
|
||||
from typing import Any, Awaitable, Callable, Generator, Iterable, TypeVar
|
||||
from typing_extensions import TypeGuard
|
||||
|
||||
from .events import AbstractEventLoop
|
||||
|
||||
@@ -25,6 +26,11 @@ else:
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
# asyncio defines 'isfuture()' in base_futures.py and re-imports it in futures.py
|
||||
# but it leads to circular import error in pytype tool.
|
||||
# That's why the import order is reversed.
|
||||
def isfuture(obj: object) -> TypeGuard[Future[Any]]: ...
|
||||
|
||||
if sys.version_info < (3, 7):
|
||||
class _TracebackLogger:
|
||||
exc: BaseException
|
||||
@@ -34,8 +40,6 @@ if sys.version_info < (3, 7):
|
||||
def clear(self) -> None: ...
|
||||
def __del__(self) -> None: ...
|
||||
|
||||
def isfuture(obj: object) -> bool: ...
|
||||
|
||||
class Future(Awaitable[_T], Iterable[_T]):
|
||||
_state: str
|
||||
_exception: BaseException
|
||||
|
||||
Reference in New Issue
Block a user