Add asyncio.tools stubs for 3.14 (#14305)

This commit is contained in:
Brian Schubert
2025-06-21 14:09:25 -04:00
committed by GitHub
parent 83a6844847
commit 707cd57e49
3 changed files with 42 additions and 1 deletions
@@ -2,7 +2,6 @@
# TODO: New errors in Python 3.14 that need to be fixed or moved below
# ====================================================================
asyncio.tools
concurrent.interpreters
multiprocessing.managers.BaseListProxy.clear
multiprocessing.managers.BaseListProxy.copy
+1
View File
@@ -95,6 +95,7 @@ asyncio.staggered: 3.8-
asyncio.taskgroups: 3.11-
asyncio.threads: 3.9-
asyncio.timeouts: 3.11-
asyncio.tools: 3.14-
asyncio.trsock: 3.8-
asyncore: 3.0-3.11
atexit: 3.0-
+41
View File
@@ -0,0 +1,41 @@
from collections.abc import Iterable
from enum import Enum
from typing import NamedTuple, SupportsIndex, type_check_only
@type_check_only
class _AwaitedInfo(NamedTuple): # AwaitedInfo_Type from _remote_debugging
thread_id: int
awaited_by: list[_TaskInfo]
@type_check_only
class _TaskInfo(NamedTuple): # TaskInfo_Type from _remote_debugging
task_id: int
task_name: str
coroutine_stack: list[_CoroInfo]
awaited_by: list[_CoroInfo]
@type_check_only
class _CoroInfo(NamedTuple): # CoroInfo_Type from _remote_debugging
call_stack: list[_FrameInfo]
task_name: int | str
@type_check_only
class _FrameInfo(NamedTuple): # FrameInfo_Type from _remote_debugging
filename: str
lineno: int
funcname: str
class NodeType(Enum):
COROUTINE = 1
TASK = 2
class CycleFoundException(Exception):
cycles: list[list[int]]
id2name: dict[int, str]
def __init__(self, cycles: list[list[int]], id2name: dict[int, str]) -> None: ...
def get_all_awaited_by(pid: SupportsIndex) -> list[_AwaitedInfo]: ...
def build_async_tree(result: Iterable[_AwaitedInfo], task_emoji: str = "(T)", cor_emoji: str = "") -> list[list[str]]: ...
def build_task_table(result: Iterable[_AwaitedInfo]) -> list[list[int | str]]: ...
def display_awaited_by_tasks_table(pid: SupportsIndex) -> None: ...
def display_awaited_by_tasks_tree(pid: SupportsIndex) -> None: ...