On this page
  1. asyncio.print_call_graph
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

asyncio.print_call_graph

Prev: asyncio.open_unix_connection | Up: asyncio | Next: asyncio.run
Rel: asyncio.AbstractEventLoop, asyncio.AbstractServer, asyncio.all_tasks, asyncio.as_completed
Ref: docs.python.org — asyncio.print_call_graph
Tags: #public #python3 #stdlib #asyncio


Import

import asyncio
from asyncio import print_call_graph

Signature & Overview

asyncio.print_call_graph(future: _asyncio.Future | None = None, /, *, file: io.Writer[str] | None = None, depth: int = 1, limit: int | None = None) -> None

Print the async call graph for the current task or the provided Future.

Usage

import asyncio
import io

async def main():
    buf = io.StringIO()
    asyncio.print_call_graph(file=buf)
    assert isinstance(buf.getvalue(), str)

asyncio.run(main())

Gotchas

REPL Inspect

from asyncio import print_call_graph
help(print_call_graph)

Linked from

Related notes