[Python-checkins] cpython (3.2): use list() to wrap range() in itertools.permutations() example; thanks to

sandro.tosi python-checkins at python.org
Sun Dec 25 17:26:17 CET 2011


http://hg.python.org/cpython/rev/6924b9548962
changeset:   74176:6924b9548962
branch:      3.2
parent:      74174:ed9a8a5dcf7a
user:        Sandro Tosi <sandro.tosi at gmail.com>
date:        Sun Dec 25 17:25:45 2011 +0100
summary:
  use list() to wrap range() in itertools.permutations() example; thanks to Romain MORLEVAT from docs@

files:
  Doc/library/itertools.rst |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -419,7 +419,7 @@
             if r > n:
                 return
             indices = list(range(n))
-            cycles = range(n, n-r, -1)
+            cycles = list(range(n, n-r, -1))
             yield tuple(pool[i] for i in indices[:r])
             while n:
                 for i in reversed(range(r)):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list