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

  1. Read the part's README.md. Type the snippets yourself; don't copy-paste.
  2. Run each file in examples/, then change something and run it again.
  3. Solve exercises.md in order: ๐ŸŸข easy โ†’ ๐ŸŸก medium โ†’ ๐Ÿ”ด challenge.
  4. Check your answer against solutions/ only after you have tried.
  5. 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

Next: ๐Ÿง  Stage 4: DSA in Python (data structures and algorithms)

Search the guide