Remove some pytype workarounds from stdlib (#14470)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Sebastian Rittau
2025-07-27 11:56:26 +01:00
committed by GitHub
co-authored by Alex Waygood pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
parent 1a256d8211
commit 7e16c80989
8 changed files with 10 additions and 40 deletions
+2 -6
View File
@@ -1,9 +1,9 @@
import sys
from _asyncio import Future as Future
from concurrent.futures._base import Future as _ConcurrentFuture
from typing import Any, TypeVar
from typing_extensions import TypeIs
from typing import TypeVar
from .base_futures import isfuture as isfuture
from .events import AbstractEventLoop
# Keep asyncio.__all__ updated with any changes to __all__ here
@@ -16,8 +16,4 @@ 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) -> TypeIs[Future[Any]]: ...
def wrap_future(future: _ConcurrentFuture[_T] | Future[_T], *, loop: AbstractEventLoop | None = None) -> Future[_T]: ...