]> granicus.if.org Git - python/commitdiff
Simplify doctest of tee().
authorRaymond Hettinger <python@rcn.com>
Sat, 13 Sep 2003 01:01:34 +0000 (01:01 +0000)
committerRaymond Hettinger <python@rcn.com>
Sat, 13 Sep 2003 01:01:34 +0000 (01:01 +0000)
Lib/test/test_itertools.py

index 8ab4cea6f00ea3369a52fe1301743589f2ef48e8..7842dd31b664795b3fd1c0b0edf1aba4c4615578 100644 (file)
@@ -607,15 +607,11 @@ False
 >>> dotproduct([1,2,3], [4,5,6])
 32
 
->>> def irange(start, stop):
-...     for i in range(start, stop):
-...         yield i
-
->>> x, y = tee(irange(2,10))
+>>> x, y = tee(chain(xrange(2,10)))
 >>> list(x), list(y)
 ([2, 3, 4, 5, 6, 7, 8, 9], [2, 3, 4, 5, 6, 7, 8, 9])
 
->>> x, y = tee(irange(2,10))
+>>> x, y = tee(chain(xrange(2,10)))
 >>> zip(x, y)
 [(2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9)]