Skip to content

_task_repr missing from stdlib/asyncio/base_tasks.pyi #15557

@jonathandung

Description

@jonathandung

There are currently three functions, all undocumented helpers, in the asyncio base_tasks stub. These are:

  • _task_repr_info(task: Task) -> list[str]
  • _task_get_stack(task: Task, limit: int|None) -> list[FrameType]
  • _task_print_stack(task: Task, limit: int|None, file: StrOrBytesPath) -> None

However, looking at the newest source (this was probably added earlier, but I don't want to dig for it):

@reprlib.recursive_repr()
def _task_repr(task):
    info = ' '.join(_task_repr_info(task))
    return f'<{task.__class__.__name__} {info}>'

The _task_repr function is missing from the stubs. Seeing as though all of its siblings, which are no more documented, are included, I presume this should be too.

Since this has a trivial fix, I will open a PR directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions