diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2018-02-03 16:46:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-03 16:46:28 (GMT) |
commit | 589c718a8e3bde017350f248f7f1c009240eb52b (patch) | |
tree | cd5b4b3e7d69f17888d0ff89a650a7b27a2a696f /Doc/library/collections.rst | |
parent | 38bfa8418f5d39bcc7478b8f7aef4a632c26172e (diff) | |
download | cpython-589c718a8e3bde017350f248f7f1c009240eb52b.zip cpython-589c718a8e3bde017350f248f7f1c009240eb52b.tar.gz cpython-589c718a8e3bde017350f248f7f1c009240eb52b.tar.bz2 |
bpo-32739: Show default value for rotate() (GH-5485)
Diffstat (limited to 'Doc/library/collections.rst')
-rw-r--r-- | Doc/library/collections.rst | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 772ff60..256bf02 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -509,11 +509,14 @@ or subtracting from an empty counter. .. versionadded:: 3.2 - .. method:: rotate(n) + .. method:: rotate(n=1) - Rotate the deque *n* steps to the right. If *n* is negative, rotate to - the left. Rotating one step to the right is equivalent to: - ``d.appendleft(d.pop())``. + Rotate the deque *n* steps to the right. If *n* is negative, rotate + to the left. + + 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: |