Python Internals and Performance
What an object really is, how memory is freed, what bytecode and attribute lookup do, how descriptors and metaclasses work, and how to measure and speed up code.
Until now you have used Python. This phase opens the machine. You will see what a name and an object really are, how Python frees memory (reference counting and the garbage collector), what bytecode looks like, and the exact steps of an attribute lookup. Those steps explain features that look like magic: methods, property, cached_property, @classmethod, dataclasses and ORMs (libraries that turn database rows into Python objects).
Then come the two tools that frameworks use to bend the language: descriptors and metaclasses. You will rebuild property and cached_property yourself, write a descriptor that validates data, and use __init_subclass__ for a plugin registry, the same trick behind many model and plugin systems in AI libraries.
The last three topics are about speed. You will measure before you optimise (timeit, cProfile, tracemalloc), learn the habits that make Python fast (the right data structure, caching, generators, vectorising), and see why NumPy is fast: contiguous C memory, the buffer protocol and loops that run outside the interpreter. Phase 14 (NumPy and pandas) builds directly on that last idea.
Practise this phase
Hands-on exercises: write the code, run it, and press Check to have it tested automatically.