Skip to content

Ambiguity in asyncio.Queue docstring #146544

@jonathandung

Description

@jonathandung

Documentation

In the asyncio.Queue source, under the Queue class declaration, it claims that asyncio.queues.qsize is reliable, unlike queue.Queue.qsize, since the size of the queue wouldn't change while getting the size of the queue in single-threaded asyncio usage. This is correct, but the docstring calls queue.Queue the "standard library Queue" here:

Unlike the standard library Queue, you can reliably know this Queue's size
with qsize(), since your single-threaded asyncio application won't be
interrupted between calling qsize() and doing an operation on the Queue.

This is ambiguous, since asyncio.Queue is technically also part of the standard library. My PR changes it to:

Unlike the thread-safe queue.Queue, you can reliably know this Queue's size
...

This problem is not present in the python docs page, which calls it the 'standard library threading queue' with a hyperlink reference to the queue module.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions