Async and concurrency
Async and concurrency
Top-three Python backend interview topic. Read in order — each file assumes the previous ones.
Foundations
Asyncio
| # |
File |
Covers |
| 05 |
05_async_python_coroutines.md |
async def, awaitables, how a coroutine runs |
| 06 |
06_event_loop_internals.md |
selectors, yield points, uvloop, Python vs JS loops |
| 07 |
07_asyncio_vs_threads.md |
the comparison, with hybrid patterns |
| 12 |
12_taskgroup_structured_concurrency.md |
TaskGroup vs gather, and picking the right primitive |
| 13 |
13_cancellation_timeouts_errors.md |
CancelledError, asyncio.timeout, shield, ExceptionGroup |
| 17 |
17_anyio_trio_structured.md |
anyio/Trio, and why libraries target them |
Choosing a model, and offloading
Coordination
Runnable examples: _examples/.
The 2026 headline
Free-threaded CPython is officially supported as of Python 3.14 (PEP 779) - no longer experimental, though still an opt-in build. Python 3.14 also added stdlib subinterpreters (PEP 734), so “threads, async, or processes?” is now a four-way question. Covered in 01_gil.md.