Deque, heap, and bisect: choosing the non-obvious container
Match queues, priorities, and sorted searches to the containers that make their dominant work cheap.
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.
Match queues, priorities, and sorted searches to the containers that make their dominant work cheap.
Follow exceptions through matching, unwinding, chaining, cleanup, exception groups, and CPython 3.14 exception tables.
Design reliable cleanup around context managers, finalizers, cycles, resurrection, shutdown, async cancellation, and process exit.
Build a small import hook while learning how finders, module specs, loaders, caches, packages, and failure cleanup divide responsibility.
Trace Python name resolution through live frames, fast locals, module globals, builtins, and the namespace rules around exec.
Separate Python call semantics from CPython vectorcall, then design APIs that avoid needless argument and boundary overhead.
Build a precise model of CPython object lifetime, cycles, finalizers, weak references, and the diagnostics that can accidentally keep objects alive.
Trace a class statement through namespace preparation, body execution, metaclass construction, descriptors, and subclass hooks.
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.