Tutorial Sneak Peek: "Lazy Looping in Practice..."
summary
Claims that Python for loops only iterate a single iterable and that common helpers are what enable indexing, reversing, and parallel looping; inspects the enumerate, zip, and reversed implementations to show how they yield items lazily and turn an O(n) allocation into O(1) streaming memory; builds three concrete looping helpers with iterators and generators, runs them on large inputs, and demonstrates they behave correctly and avoid eager copying.
AI-written summary · about
related talks
25mLazy Looping: The Next Iteration
28mWhy Python Loops Are "Slow": A Gentle Introduction to Interpretation, Bytecode, and Fast Code
44mIterables and Iterators: Going Loopy With Python
28mLoop better: a deeper look at iteration in Python
03mReimplement `itertools` for fun & profit
29mPythonic iterators and generators
52mPython Tips, Tricks, and Idioms
32mIterating Efficiently in Python with itertools
