Stage 3
Stage 3: Advanced
Goal: Write Python that is fast where it needs to be (threads, processes,
asyncio), understand what the language is doing underneath, type and handle errors like a professional, and ship your own code as an installable package. Time: about 2 weeks at ~1 hour a day (~12โ14 hours including the project) ยท Level: you have finished Stage 2
Parts in this stage
Do them in order. Each part builds on the ones before it. When a later topic shows up early, it is marked with a note like (Part 15).
| Part | Topic | You will build | Time |
|---|---|---|---|
| 13 | Concurrency | Parallel file downloader | ~1 h |
| 14 | Python internals | Find the slow function in a script | ~1 h |
| 15 | Advanced typing and errors | Route webhook events with match |
~1 h |
| 16 | Packaging and modern Python | Publish your own CLI tool | ~1 h |
| ๐ | Project: Async web scraper | A packaged command-line crawler: asyncio + html.parser + SQLite | ~8โ10 h |
How every part is organised
part-NN-topic/
โโโ README.md โ 1. read the lesson
โโโ examples/ โ 2. run the example programs
โโโ exercises.md โ 3. solve the practice questions yourself
โโโ solutions/ โ 4. only then compare with the solution
How to study each part
- Read the part's
README.md. Type the snippets yourself; don't copy-paste. - Run each file in
examples/, then change something and run it again. - Solve
exercises.mdin order: ๐ข easy โ ๐ก medium โ ๐ด challenge. - Check your answer against
solutions/only after you have tried. - Tick the โ checklist at the end of the part.
๐ก Already experienced? Skim the beginner text and look for the ๐ Going deeper notes โ Stage 3 leans on them more than earlier stages, since a lot of this material is "how Python really works", not just "how to write a program".
How to run the code
python3 stage-3-advanced/part-13-concurrency/examples/08_parallel_downloader.py
On Windows, use python (or py) instead of python3. Parts 13 and 14 use only the standard library. The project adds pytest (already installed if you followed Stage 2, Part 11):
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install pytest
Everything in this stage runs offline. Where a part needs something slow to talk to (a file download, a web page), it uses a tiny local HTTP server that runs on your own computer โ see part-13-concurrency/examples/file_server.py and the project's testserver/. No example or test in Stage 3 reaches the real internet.
Stage 3 checklist
- Parts 13โ16 done, with every exercise attempted
- Async web scraper project built, with all its tests passing
- You can explain, in your own words, when to reach for threads, processes or
asyncio - You can package a project with
pyproject.tomland run it as an installed CLI command - (Optional) Took a PCPP1 practice test (the Python Institute's professional-level Python certificate)
Next: ๐ง Stage 4: DSA in Python (data structures and algorithms)