xavdid, I'm over the moon that the #Python helper function I write more than any other,
chunks
, is coming to the stdlib in 3.12 asitertools.batched(iterable, n)
! It takes a long iterable and yields chucks (or batches) of lengthn
.I think I've pasted the same Stackoverflow snippet into... 10 projects at this point? So this is huge for me.
https://docs.python.org/3.12/library/itertools.html#itertools.batched
Add comment