]> granicus.if.org Git - python/commitdiff
#7721: replace code that works only in 2.7+ with equivalent.
authorGeorg Brandl <georg@python.org>
Mon, 5 Apr 2010 11:46:16 +0000 (11:46 +0000)
committerGeorg Brandl <georg@python.org>
Mon, 5 Apr 2010 11:46:16 +0000 (11:46 +0000)
Doc/library/functions.rst

index 26aa745a52b09e1dc3f0144942506eadb0fc2883..b7646629d1295cd8696a055e455faabd9e285b63 100644 (file)
@@ -1390,8 +1390,8 @@ available.  They are listed here in alphabetical order.
       restricts all arguments to native C longs ("short" Python integers), and
       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)``.
+      :mod:`itertools` module: ``takewhile(lambda x: x<stop, (start+i*step
+      for i in count()))``.
 
 
 .. function:: zip([iterable, ...])