Python

From first scripts to idiomatic, production-quality Python.

4 articles

A Python generator function handing out squared numbers one at a time, with the next value not computed yet
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.

6 min read
A function wrapped inside two decorator layers, @retry and @timed
PythonIntermediate

Python Decorators Explained Step by Step

Decorators look like magic, but they're just functions that wrap functions. Build your own timing and retry decorators from scratch.

4 min read