Iterators, generators, decorators, type hints, async, and internals
How for loops actually work under the hood. The iterator protocol, __iter__, __next__, StopIteration, and building your own.
Process huge datasets without running out of memory. yield, generator expressions, and lazy evaluation in practice.
Wrap functions to add behavior — logging, timing, caching, access control. Step-by-step from closures to @decorator syntax.
Add type annotations to your Python code. int, str, List, Optional, Union, generics, and catching bugs before runtime with mypy.
Structural typing for Python — define interfaces without inheritance. If it walks like a duck and types like a duck...
Validate and parse data with type annotations. BaseModel, field validators, serialization, and catching bad data at the boundary.
Mutable default arguments, late binding closures, integer caching, and other gotchas that trip up even experienced Python developers.
Threading for I/O, multiprocessing for CPU, asyncio for many connections. Know which tool fits which problem.
Write non-blocking code with async/await. Coroutines, the event loop, asyncio.gather, and real-world async patterns.
Factory, Strategy, Observer, Singleton, and more — classic patterns translated into idiomatic Python.
Peek under the hood: CPython, bytecode, the GIL, reference counting, garbage collection, and how memory actually works.
Build command-line programs with argparse and sys.argv. Parse flags, add help text, and make your scripts user-friendly.