mirror of
https://github.com/python/cpython.git
synced 2025-10-01 12:52:18 +00:00
bpo-32739: Show default value for rotate() (GH-5485) (GH-5515)
(cherry picked from commit 589c718a8e
)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
This commit is contained in:
parent
72584d23a5
commit
7eb3d1e7da
1 changed files with 7 additions and 4 deletions
|
@ -509,11 +509,14 @@ or subtracting from an empty counter.
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
|
|
||||||
.. method:: rotate(n)
|
.. method:: rotate(n=1)
|
||||||
|
|
||||||
Rotate the deque *n* steps to the right. If *n* is negative, rotate to
|
Rotate the deque *n* steps to the right. If *n* is negative, rotate
|
||||||
the left. Rotating one step to the right is equivalent to:
|
to the left.
|
||||||
``d.appendleft(d.pop())``.
|
|
||||||
|
When the deque is empty, rotating one step to the right is equivalent
|
||||||
|
to ``d.appendleft(d.pop())``, and rotating one step to the left is
|
||||||
|
equivalent to ``d.append(d.popleft())``.
|
||||||
|
|
||||||
|
|
||||||
Deque objects also provide one read-only attribute:
|
Deque objects also provide one read-only attribute:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue