[Python-checkins] bpo-32739: Show default value for rotate() (GH-5485)

Raymond Hettinger webhook-mailer at python.org
Sat Feb 3 11:46:36 EST 2018


https://github.com/python/cpython/commit/589c718a8e3bde017350f248f7f1c009240eb52b
commit: 589c718a8e3bde017350f248f7f1c009240eb52b
branch: master
author: Raymond Hettinger <rhettinger at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-02-03T08:46:28-08:00
summary:

bpo-32739: Show default value for rotate() (GH-5485)

files:
M Doc/library/collections.rst

diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index 772ff60fe983..256bf02da47c 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:



More information about the Python-checkins mailing list