Skip to content

In asyncio.Queue documentation, the raise of QueueShutDown exception is missing in put_nowait and get_nowaitmethods #152614

Description

@YvesDup

Documentation

The put_nowait method can raise a QueueShutDownexception, see:

def put_nowait(self, item):
"""Put an item into the queue without blocking.
If no free slot is immediately available, raise QueueFull.
Raises QueueShutDown if the queue has been shut down.
"""
if self._is_shutdown:
raise QueueShutDown
if self.full():

But this raise is missing in the put_nowait method entry of the documentation

.. method:: put_nowait(item)
Put an item into the queue without blocking.
If no free slot is immediately available, raise :exc:`QueueFull`.

The same problem exists with the get_nowait method.

Moreover, this 2 methods are not referenced in the QueueShutDown exception section.

.. exception:: QueueShutDown
Exception raised when :meth:`~Queue.put` or :meth:`~Queue.get` is
called on a queue which has been shut down.

I can submit a PR, quickly.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    Status
    Todo
    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions