Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simpler but slightly slower code
  • Loading branch information
rhettinger committed May 18, 2024
commit 0758bbe16e5738281eddb65de863968d80b9f36f
3 changes: 2 additions & 1 deletion Doc/library/itertools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,8 @@ loops that truncate the stream.
try:
while True:
if link[1] is None:
link[:] = [next(iterator), [None, None]]
link[0] = next(iterator)
link[1] = [None, None]
value, link = link
yield value
except StopIteration:
Expand Down