Generators Will Free Your Mind
summary
Claims that generators remove API-mode assumptions and avoid needless work with lazy streams. Demos show a 50-line meeting scheduler, a trading-query case where a list-returning API blows memory on millions of trades and a generator fixes it, and a Fibonacci example composed with itertools.islice and generator expressions to select values. Techniques include composing streams, co-routines send() for ordered callbacks, and a greedy coin algorithm built from chained generators. Notes caveat that generators can be slower but let slow parts be swapped for C extensions.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:39Meet the speaker
- 6:15Programming as engineering
- 10:47Functional programming
- 17:24Generators and why they matter
- 22:18Generators free you
- 30:23Simplifying APIs
- 37:46Generators in practice
- 42:20Q&A
related talks
01h 26mBeyond Python Enhanced Generators
27mWhen to refactor your code into generators and how
30mWhat are you yield from?
42mAre generator-coroutines really the answer?
25mLazy Looping: The Next Iteration
01h 26mBeyond Python Enhanced Generators
41mMore About Generators
20mIt's Critical: Concurrent programming as a sane programming model
