]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Docs: Improve example for ``itertools.batched()`` (#136775)
authorRafaelWO <38643099+RafaelWO@users.noreply.github.com>
Sat, 19 Jul 2025 09:29:44 +0000 (11:29 +0200)
committerGitHub <noreply@github.com>
Sat, 19 Jul 2025 09:29:44 +0000 (10:29 +0100)
commit3eecc72ac70943f7e33297eea17803af15322c88
tree08d7d02c849d99454485271877770a8657fde366
parent60146f4f6f24f37e3bfcb9f101565f6e86cf0146
Docs: Improve example for ``itertools.batched()`` (#136775)

The current example `batched('ABCDEFG', n=3) → ABC DEF G` can confuse readers because both, the size of the tuples and the number of tuples are 3.
By using a batch size of n=2, it is clearer that the `n` argument refers to the size of the resulting tuples.
I.e. the new example is: `batched('ABCDEFG', n=2) → AB CD EF G`
Doc/library/itertools.rst