finds.dev← search

// the find

dabeaz/generators

★ 444 · updated Jul 2023

Generator Tricks for Systems Programmers (Tutorial)

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.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →