mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +00:00
Simplify doctest of tee().
This commit is contained in:
parent
cbe81f2a72
commit
42a61ed277
1 changed files with 2 additions and 6 deletions
|
@ -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)]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue