Asyncio cancellation is part of your API
Design coroutine cleanup, deadlines, and cancellation propagation as observable interface behavior.
Independent field notes / Vol. 01
Precise explanations of the machinery, patterns, and tradeoffs that make Python feel deceptively simple.
Read the cover storyThe index
6 notes, edited for signal.
Design coroutine cleanup, deadlines, and cancellation propagation as observable interface behavior.
Design process workers around explicit values, importable callables, transfer costs, and start-method realities.
Use structured concurrency to make child lifetime, sibling cancellation, and multiple failures explicit.
Replace sleeps and scheduler luck with barriers, events, bounded waits, and observable lifecycle assertions.
Choose a concurrency mechanism by locating blocked resources, ownership boundaries, and coordination costs.
What CPython locks, what it does not guarantee, and how free-threaded Python changes the decision.
Editorial policy
No listicles. No folklore. No just trust me abstractions.
Every note should leave you with a better model of the system, not just another snippet to paste.