Skip to content

document positional-only arguments for collections.deque #100444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Doc/library/collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -477,12 +477,12 @@ or subtracting from an empty counter.

Deque objects support the following methods:

.. method:: append(x)
.. method:: append(x, /)

Add *x* to the right side of the deque.


.. method:: appendleft(x)
.. method:: appendleft(x, /)

Add *x* to the left side of the deque.

Expand All @@ -499,27 +499,27 @@ or subtracting from an empty counter.
.. versionadded:: 3.5


.. method:: count(x)
.. method:: count(x, /)

Count the number of deque elements equal to *x*.

.. versionadded:: 3.2


.. method:: extend(iterable)
.. method:: extend(iterable, /)

Extend the right side of the deque by appending elements from the iterable
argument.


.. method:: extendleft(iterable)
.. method:: extendleft(iterable, /)

Extend the left side of the deque by appending elements from *iterable*.
Note, the series of left appends results in reversing the order of
elements in the iterable argument.


.. method:: index(x[, start[, stop]])
.. method:: index(x[, start[, stop]], /)

Return the position of *x* in the deque (at or after index *start*
and before index *stop*). Returns the first match or raises
Expand All @@ -528,7 +528,7 @@ or subtracting from an empty counter.
.. versionadded:: 3.5


.. method:: insert(i, x)
.. method:: insert(i, x, /)

Insert *x* into the deque at position *i*.

Expand All @@ -550,7 +550,7 @@ or subtracting from an empty counter.
elements are present, raises an :exc:`IndexError`.


.. method:: remove(value)
.. method:: remove(value, /)

Remove the first occurrence of *value*. If not found, raises a
:exc:`ValueError`.
Expand All @@ -563,7 +563,7 @@ or subtracting from an empty counter.
.. versionadded:: 3.2


.. method:: rotate(n=1)
.. method:: rotate(n=1, /)

Rotate the deque *n* steps to the right. If *n* is negative, rotate
to the left.
Expand Down