]> granicus.if.org Git - python/commitdiff
bpo-32739: Show default value for rotate() (GH-5485)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Sat, 3 Feb 2018 16:46:28 +0000 (08:46 -0800)
committerGitHub <noreply@github.com>
Sat, 3 Feb 2018 16:46:28 +0000 (08:46 -0800)
Doc/library/collections.rst

index 772ff60fe9839acdbdd90c5ca6e7b554a58ee87e..256bf02da47c8bd748ae96579c93554b9aef6f96 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: