Skip to content

Commit

Permalink
Merge pull request #315 from eriknw/pep479
Browse files Browse the repository at this point in the history
Prepare for PEP 479 to take effect in Python 3.6+.
  • Loading branch information
eriknw committed Aug 10, 2016
2 parents afce547 + 6e04048 commit bb66d36
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions toolz/itertoolz.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ def sliding_window(n, seq):
# An efficient FIFO data structure with maximum length
d = collections.deque(itertools.islice(it, n), n)
if len(d) != n:
raise StopIteration()
return
d_append = d.append
for item in it:
yield tuple(d)
Expand Down Expand Up @@ -722,7 +722,10 @@ def partition_all(n, seq):
"""
args = [iter(seq)] * n
it = zip_longest(*args, fillvalue=no_pad)
prev = next(it)
try:
prev = next(it)
except StopIteration:
return
for item in it:
yield prev
prev = item
Expand Down

0 comments on commit bb66d36

Please sign in to comment.