More About Generators
summary
Generations of Python features start with PEP-255 and PEP-342 and the claim here is concrete: generators act as coroutines and sequencing primitives but rarely appear in data science because Python is slow for numeric work. The demo times a million-element moving average showing about 0.09s (NumPy) versus ~2s (pure Python/generators), then builds a working graph computation framework in ~82 lines using generators, dirty‑propagation and NetworkX drawing.
AI-written summary · about
chapters (19)
- 0:00About PyData and introducing generators
- 1:50Hacking the Python print function
- 4:36Overview of the talk
- 5:32Review
- 6:25Three different implementations of the add function
- 8:15Adding a state variable, the difference between class and function
- 11:05A compute function with sleep
- 13:55Using the generator pattern with __iter__ and __next__
- 15:15Differences in approaches: laziness, storage
- 17:27What generators are
- 19:40Pipelines and nwise function
- 21:05Writing a basic scheduler with generators
- 23:05Why they are not what you think they are
- 23:40Timing code and Python not being optimal vs Perl for scientists
- 27:55Have some fun, computing graphs
- 29:10Implementing a graph structure with generators
- 31:20Improving the design with more laziness
- 38:00Final version of the code (propagation in nodes of a graph)
- 39:00Conclusion








