xavdid,
@xavdid@mastodon.social avatar

I'm over the moon that the helper function I write more than any other, chunks, is coming to the stdlib in 3.12 as itertools.batched(iterable, n)! It takes a long iterable and yields chucks (or batches) of length n.

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

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programming
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines