Tutorial sequence
Identity, Memory, and Lifetime
5of 5 published
- 01Read
advanced / 30 min
Names are references, but that slogan is not enough
Build a precise model of binding, mutation, copying, argument passing, closure cells, identity, and API ownership.
- 02Read
advanced / 33 min
Reference counting and cyclic garbage collection
Build a precise model of CPython object lifetime, cycles, finalizers, weak references, and the diagnostics that can accidentally keep objects alive.
- 03Read
advanced / 32 min
Inside CPython's allocator
Connect Python allocations to pymalloc arenas, pools, blocks, process RSS, tracemalloc domains, and responsible measurement.
- 04Read
advanced / 30 min
Weak references and caches that can let go
Use weak references, weak containers, and finalizers without confusing reachability, equality, callbacks, or cache policy.
- 05Read
advanced / 31 min
Finalization is where simple models fail
Design reliable cleanup around context managers, finalizers, cycles, resurrection, shutdown, async cancellation, and process exit.