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
...
Activity
picnixz commented on Mar 28, 2026
I think it's a relicate of a time when asyncio was a PyPI package so good catch.
gh-146544: Fix `asyncio.Queue` docstring ambiguity (#146545)
pythongh-146544: Fix `asyncio.Queue` docstring ambiguity (pythonGH-14…
pythongh-146544: Fix `asyncio.Queue` docstring ambiguity (pythonGH-14…
[3.13] gh-146544: Fix `asyncio.Queue` docstring ambiguity (GH-146545) (…
[3.14] gh-146544: Fix `asyncio.Queue` docstring ambiguity (GH-146545) (…
pythongh-146544: Fix `asyncio.Queue` docstring ambiguity (python#146545)
pythongh-146544: Fix `asyncio.Queue` docstring ambiguity (python#146545)