Curriculum for this repository. For the quickstart, see the main README. For pedagogy (Q/A/R, instrumentation), see Teaching Method.
These exercises assume you can read and write Python at a working-engineer level (functions, classes, exceptions, packaging basics). They are not a first programming course.
- Solid on basics, new to asyncio: Use Cursor with
"profile: junior"for gentler explanations; you still work the same tests. - Absolute beginners: Use an introductory Python resource first, then return here for mechanism-level practice.
The project requires Python 3.11+.
Each row is a learning_* directory. Registered tests are lesson files discovered by pytest under that module’s tests/ directory.
| Module | Registered tests | Notes |
|---|---|---|
| learning_asyncio | 4 | Coroutine basics, tasks/gather, Event/Queue, cancellation/timeouts. |
| examples | 1 | test_try_it_out — good first run after install. |
- Orientation —
pip install -e ".[dev]", thenpytest examples/test_try_it_out.py -v. - Asyncio / coroutines — work
learning_asyncioone lesson file at a time:test_coroutine_basics.pytest_tasks_and_gather.pytest_event_and_queue.pytest_cancellation_and_timeouts.py
| Area | Indicative hours | Comment |
|---|---|---|
| Asyncio / coroutines | 8–12 | Four lesson files; cancellation/shield is the steepest. |
You can explain, with EventLog evidence:
- Why calling an
async defdoes not run its body - How
create_task/gatherschedule concurrent progress - How
EventandQueuecoordinate without threads - How cancellation and
wait_forinteract withshieldand why swallowingCancelledErrorbreaks the contract