bpo-32739: Show default value for rotate() (GH-5517) · python/cpython@42e8ea9

Original file line numberDiff line numberDiff line change

@@ -311,11 +311,14 @@ counts, but the output will exclude results with counts of zero or less.

311311
312312

.. versionadded:: 2.7

313313
314-

.. method:: rotate(n)

314+

.. method:: rotate(n=1)

315315
316316

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

317-

the left. Rotating one step to the right is equivalent to:

318-

``d.appendleft(d.pop())``.

317+

the left.

318+
319+

When the deque is empty, rotating one step to the right is equivalent to

320+

``d.appendleft(d.pop())``, and rotating one step to the left is

321+

equivalent to ``d.append(d.popleft())``.

319322
320323
321324

Deque objects also provide one read-only attribute: