Update itertools recipes to use next().
This commit is contained in:
parent
6d327b0d53
commit
21315ba9c8
|
@ -652,8 +652,7 @@ which incur interpreter overhead.
|
|||
def pairwise(iterable):
|
||||
"s -> (s0,s1), (s1,s2), (s2, s3), ..."
|
||||
a, b = tee(iterable)
|
||||
for elem in b:
|
||||
break
|
||||
next(b, None)
|
||||
return zip(a, b)
|
||||
|
||||
def grouper(n, iterable, fillvalue=None):
|
||||
|
|
Loading…
Reference in New Issue