Import state, module caches, and test isolation
Test import-time behavior without confusing module caching, finder caches, reload, and process isolation.
Independent field notes / Vol. 01
Precise explanations of the machinery, patterns, and tradeoffs that make Python feel deceptively simple.
Read the cover storyThe index
29 notes, edited for signal.
Test import-time behavior without confusing module caching, finder caches, reload, and process isolation.
Pointers, overallocation, shifting costs, and the choices hidden behind Python list operations.
Build a precise model of binding, mutation, copying, argument passing, closure cells, identity, and API ownership.
Use disassembly as versioned evidence, connect stack operations to source semantics, and avoid turning CPython opcodes into false contracts.
Hash tables for membership, uniqueness, algebra, and the costs sets deliberately trade away.
Understand slotted storage, descriptors, inheritance, weak references, and when measured memory savings justify the constraints.
Inspect how CPython 3.14 adapts hot bytecode to stable runtime types, and where it cannot help.
Code points, compact representations, allocation behavior, and the boundaries where text becomes bytes.
Editorial policy
No listicles. No folklore. No just trust me abstractions.
Every note should leave you with a better model of the system, not just another snippet to paste.