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

Raymond Hettinger webhook-mailer at python.org
Sat Feb 3 16:57:05 EST 2018


https://github.com/python/cpython/commit/42e8ea9f69c133a4bbb9e496f68a05926b99c2da
commit: 42e8ea9f69c133a4bbb9e496f68a05926b99c2da
branch: 2.7
author: Raymond Hettinger <rhettinger at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-02-03T13:57:02-08:00
summary:

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

Manual backport of GH-5485

files:
M Doc/library/collections.rst

diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index 25e5e22fa37f..a517a2eecfa9 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -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:



More information about the Python-checkins mailing list