finds.dev

dabeaz/generators

Generator Tricks for Systems Programmers (Tutorial)

View on GitHub

★ 444updated Jul 2023

// the take

A PyCon 2008 tutorial by David Beazley on using Python generators for systems programming tasks — log parsing, file crawling, network pipelines, co-routines. Updated for Python 3.7 in 2018. It's a teaching artifact, not a library.

The examples are concrete and runnable — Apache log parsing, tail -f simulation, TCP receivers — not contrived toy problems. Beazley's pipeline composition style (chain of generators feeding each other) is genuinely elegant and the examples show it at its best. Co-routine coverage in parts 11+ predates most tutorials that explain send() and the coroutine pattern. The PDF slides are included in the repo, so you get the full presentation without needing an internet connection.

This is a 2008 tutorial. The patterns it teaches predate asyncio entirely, so the 'async pipeline' story it tells with threads and queues is now mostly solved differently in Python 3.11+. Nothing in here covers async generators, which are the obvious evolution of everything this tutorial builds toward. It's also a static PDF + example files — no exercises, no tests, no way to verify your understanding. And 444 stars for a 16-year-old tutorial by a well-known author suggests it's more archived than actively discovered.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
444
Forks
100
Last commit
19 Jul 2023

// nearby

If generators isn't quite it.

All repos →