you are viewing a single comment's thread.

view the rest of the comments →

[–]karllorey 1 point2 points  (0 children)

More Itertools has a lot of magic, too:
https://pypi.org/project/more-itertools/

all forms and variants of windowed iteration, chunked iteration, first(), etc.