]> granicus.if.org Git - python/commitdiff
bpo-32739: Show default value for rotate() (GH-5485) (GH-5515)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 3 Feb 2018 18:27:40 +0000 (10:27 -0800)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>
Sat, 3 Feb 2018 18:27:40 +0000 (10:27 -0800)
(cherry picked from commit 589c718a8e3bde017350f248f7f1c009240eb52b)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Doc/library/collections.rst

index d6d2056dfc496c96ed2b3ba28cd18df9ef435621..97f513533ed8ff0c709d97732aa0d196c7754a57 100644 (file)
@@ -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: