Twenty-three chapters on why the language is built the way it is. Not a reference and not a list of gotchas: nine decisions made long ago and everything that follows from them — so that answers can be derived instead of remembered.
Each chapter has three levels. L1 is a complete answer: mechanism, reason, trade-off; it is enough to make the right decisions in code. L2 is the in-memory structure and the numbers. L3 is the exact place in the CPython sources. L1 never sends you down without a reason: when it leaves something out, it says under which conditions that starts to matter.
The chapters are linked by derivation, so on a first read the order is not arbitrary: some consequences cannot be obtained without accepting the previous root. Below, the roots come in exactly that order, not by number.
R1 comes first because nothing can be derived without it. R3 follows immediately: an object's lifetime is a direct consequence of a value being an object, and the GIL comes from the same place. R6 is late because it needs both R1 and R3. R9 is last: it is not a mechanism but the frame in which all the other decisions were made, and you can only judge it once you know them.
Non-obvious claims in the text carry a badge. Telling these three things apart is a skill of its own, and it matters more than any single fact.
A single object model with no primitives: one rule instead of two — and a header on every number as the price.
+= and the difference between is and == all follow.readyinsert(0), why a million numbers weigh 36 MB.readyThe count gives deterministic destruction — and it is also what forces the GIL: the convenient with is paid for with a global lock.
with that works — and hence the GIL.ready__del__, turning the collector off, and why RSS is not a measure of a leak.readyLookup at the moment of access is the source of all the language's expressiveness and the reason for twenty years of slow attribute access.
obj.x, end to endA four-step procedure: descriptors, property, explicit self, __slots__, inline caches.ready__new__ versus __init__, C3 linearization, what super() actually does.readytype as a class factory — and why application code almost always gets by with __init_subclass__.readywraps, lru_cache on a method as a quiet leak.readyAn interface is not a declaration but a set of dunders; checkable contracts were bolted onto the language twice, both times much later.
len() is a function, ABCs in 2007 and Protocol in 2017.ready__exit__ to suppress an exception, return in finally, two chains of causes.readyOne protocol out of which generators grew — and out of generators, all of async.
yield fromThe single-use iterator, the suspended frame, and why a loop does not replace yield from.readyTaskGroup versus gather.readyA module is executed once and lives for the whole process: hence circular imports and half of the oddities in tests.
The boundary the whole scientific stack stands on — and the same one that keeps the GIL from simply being removed.
memoryview, why numpy parallelizes with threads and a loop does not.readyTypes are optional as a matter of principle: there are no proofs, but migrating a huge codebase becomes possible.
TYPE_CHECKING, why a separate validation layer is needed.readyAfter Python 3, breaking things is off the table. An implementation detail becomes a promise exactly when too much code has come to lean on it.
There are no separate chapters: this is a frame, not a mechanism. It lives as an essay on the root's page.
Five topics, each resting on several roots at once and therefore coming after them. The last two are the whole pipeline: you can read them first, as a map of the machine, or last, as everything else brought together.
python script.py to a code object: interpreter startup, tokenizer, parser, symbol table, compiler, .pyc.readyThree pages on top of the chapters. They make sense after the first pass: taken one by one they look like references, but they work as a check that the roots have come together.
The “get a feel for it” layer: a mechanism described in words and a mechanism you have turned with your own hands settle differently. Three interactive pages; they work on a phone and load nothing from the network.