]> granicus.if.org Git - python/commitdiff
Issue 12003: fixing error in xrange alternative sample
authorEli Bendersky <eliben@gmail.com>
Mon, 23 May 2011 03:10:26 +0000 (06:10 +0300)
committerEli Bendersky <eliben@gmail.com>
Mon, 23 May 2011 03:10:26 +0000 (06:10 +0300)
Doc/library/functions.rst

index 4b63c9f70e782c859515acb506a99c99c2e3d5fb..962a53d45eab666dffd04b20842e265eaaff8bf4 100644 (file)
@@ -1464,7 +1464,7 @@ available.  They are listed here in alphabetical order.
       also requires that the number of elements fit in a native C long.  If a
       larger range is needed, an alternate version can be crafted using the
       :mod:`itertools` module: ``islice(count(start, step),
-      (stop-start+step-1)//step)``.
+      (stop-start+step-1+2*(step<0))//step)``.
 
 
 .. function:: zip([iterable, ...])