Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add asyncio.graph, updates to asyncio.futures (3.14) #14003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 12, 2025
Prev Previous commit
Next Next commit
Address comments
  • Loading branch information
max-muoto committed May 11, 2025
commit b13953183f594a30f9308d05ed6e3d8e3b441066
17 changes: 8 additions & 9 deletions 17 stdlib/asyncio/graph.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from asyncio import Future
from dataclasses import dataclass
from types import FrameType
from typing import Any, Generic, TextIO, TypeVar, overload
from typing import Any, TextIO, overload

_T = TypeVar("_T")

__all__ = ("capture_call_graph", "format_call_graph", "print_call_graph", "FrameCallGraphEntry", "FutureCallGraph")

Expand All @@ -12,16 +11,16 @@ class FrameCallGraphEntry:
frame: FrameType

@dataclass(frozen=True)
class FutureCallGraph(Generic[_T]):
future: Future[_T]
class FutureCallGraph:
future: Future[Any]
call_stack: tuple[FrameCallGraphEntry, ...]
awaited_by: tuple[FutureCallGraph[Any], ...]
awaited_by: tuple[FutureCallGraph, ...]

@overload
def capture_call_graph(future: None = None, /, *, depth: int = 1, limit: int | None = None) -> FutureCallGraph[Any] | None: ...
def capture_call_graph(future: None = None, /, *, depth: int = 1, limit: int | None = None) -> FutureCallGraph | None: ...
@overload
def capture_call_graph(future: Future[_T], /, *, depth: int = 1, limit: int | None = None) -> FutureCallGraph[_T] | None: ...
def format_call_graph(future: Future[_T] | None = None, /, *, depth: int = 1, limit: int | None = None) -> str: ...
def capture_call_graph(future: Future[Any], /, *, depth: int = 1, limit: int | None = None) -> FutureCallGraph | None: ...
def format_call_graph(future: Future[Any] | None = None, /, *, depth: int = 1, limit: int | None = None) -> str: ...
def print_call_graph(
future: Future[_T] | None = None, /, *, file: TextIO | None = None, depth: int = 1, limit: int | None = None
future: Future[Any] | None = None, /, *, file: TextIO | None = None, depth: int = 1, limit: int | None = None
) -> None: ...
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.