Skip to content

Commit 52f7458

Browse files
bpo-32739: Show default value for rotate() (GH-5485) (GH-5514)
(cherry picked from commit 589c718) Co-authored-by: Raymond Hettinger <[email protected]>
1 parent f33eced commit 52f7458

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Doc/library/collections.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -509,11 +509,14 @@ or subtracting from an empty counter.
509509
.. versionadded:: 3.2
510510

511511

512-
.. method:: rotate(n)
512+
.. method:: rotate(n=1)
513513

514-
Rotate the deque *n* steps to the right. If *n* is negative, rotate to
515-
the left. Rotating one step to the right is equivalent to:
516-
``d.appendleft(d.pop())``.
514+
Rotate the deque *n* steps to the right. If *n* is negative, rotate
515+
to the left.
516+
517+
When the deque is empty, rotating one step to the right is equivalent
518+
to ``d.appendleft(d.pop())``, and rotating one step to the left is
519+
equivalent to ``d.append(d.popleft())``.
517520

518521

519522
Deque objects also provide one read-only attribute:

0 commit comments

Comments
 (0)