]> granicus.if.org Git - python/commitdiff
bpo-32739: Show default value for rotate() (GH-5517)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Sat, 3 Feb 2018 21:57:02 +0000 (13:57 -0800)
committerGitHub <noreply@github.com>
Sat, 3 Feb 2018 21:57:02 +0000 (13:57 -0800)
Manual backport of GH-5485

Doc/library/collections.rst

index 25e5e22fa37fdb3ed67e78e0351fe316d09e96a7..a517a2eecfa9d177cb4f820ab68bd2a8352d479a 100644 (file)
@@ -311,11 +311,14 @@ counts, but the output will exclude results with counts of zero or less.
 
       .. versionadded:: 2.7
 
-   .. 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())``.
+      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: