From: Eli Bendersky Date: Mon, 23 May 2011 03:10:26 +0000 (+0300) Subject: Issue 12003: fixing error in xrange alternative sample X-Git-Tag: v2.7.2rc1~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=29f6efa844950fa50cb58a0fe6ace584954df157;p=thirdparty%2FPython%2Fcpython.git Issue 12003: fixing error in xrange alternative sample --- diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 4b63c9f70e78..962a53d45eab 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -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, ...])