Reimplement `itertools` for fun & profit
summary
Reimplements the module itertools by coding 19 iterators in pure Python reimplementation, with automated tests pulled from the GitHub repo to validate behavior. Demonstrates that range is lazy — range(1) and range(99999999999999999) take the same time and constant memory — and shows how next and iter make for loops work. Exercises run in a loop with test feedback, and a working 7–8 line while loop replaces for in the demos.
AI-written summary · about
chapters (5)
related talks
33mA tour of the module itertools
29mPythonic iterators and generators
25mLazy Looping: The Next Iteration
44mIterables and Iterators: Going Loopy With Python
02mTutorial Sneak Peek: "Lazy Looping in Practice..."
02h 28mFunctional Python
24mMeta Generators: Playing Safe with Long Sequences
25mThe Standard Library Tour
