diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-02-03 18:27:40 (GMT) |
---|---|---|
committer | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2018-02-03 18:27:40 (GMT) |
commit | 7eb3d1e7da42112ba879a5f8602891fa17963f9e (patch) | |
tree | e111062b8c9db65fd66c1925ed28ba9c14968c51 /Doc | |
parent | 72584d23a54855ef5843d7475b7c5a904e3ef713 (diff) | |
download | cpython-7eb3d1e7da42112ba879a5f8602891fa17963f9e.zip cpython-7eb3d1e7da42112ba879a5f8602891fa17963f9e.tar.gz cpython-7eb3d1e7da42112ba879a5f8602891fa17963f9e.tar.bz2 |
bpo-32739: Show default value for rotate() (GH-5485) (GH-5515)
(cherry picked from commit 589c718a8e3bde017350f248f7f1c009240eb52b)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Diffstat (limited to 'Doc')
-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 d6d2056..97f5135 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: |