English
Topic 7. Iterators, generators, generator expressions, lambda functions, and decorators
Goal: learn to create and consume lazy sequences, combine itertools tools, choose sorting keys, and write typed decorators that preserve metadata.
Lecture contents
- Iterators and generator functions — Iterables and iterators · Generator functions and yield
- Lazy evaluation and itertools — Generator expressions and lazy evaluation · Ready-made itertools building blocks · A pipeline: temperature log
- Lambda expressions and decorators — Lambda expressions and higher-order functions · A decorator as a function wrapper
- Parameterized decorators — Parameterized decorators, retries, and timing · Debugging and common mistakes