PythonIntermediate
Python Generators: Lazy Iteration with yield
How yield turns a function into a generator, why generators use almost no memory, and how to build lazy data pipelines with them in Python.
From first scripts to idiomatic, production-quality Python.
4 articles
How yield turns a function into a generator, why generators use almost no memory, and how to build lazy data pipelines with them in Python.
@property, bound methods, cached_property and __slots__ all run on one small protocol. Learn how descriptors work, the exact attribute lookup order, and how to write your own.
Learn how list comprehensions work, when they make your code clearer, and when a plain for-loop is still the better choice.
Decorators look like magic, but they're just functions that wrap functions. Build your own timing and retry decorators from scratch.