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
Flatten before joining
  • Loading branch information
rhettinger committed Oct 17, 2022
commit 7fd40169f6fdb9c12183db67cef3851dd017e775
2 changes: 1 addition & 1 deletion Lib/test/test_itertools.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def test_batched(self):
batches = list(batched(s, n))
with self.subTest(s=s, n=n, batches=batches):
# Order is preserved and no data is lost
self.assertEqual(''.join(batches), s)
self.assertEqual(''.join(chain(*batches)), s)
# Each batch is an exact list
self.assertTrue(all(type(batch) == list for batch in batches))
Comment thread
rhettinger marked this conversation as resolved.
Outdated
# All but the last batch is of size n
Expand Down