Tutorial sequence
Object Model and Protocols
5of 5 published
- 01Read
intermediate / 24 min
Iterators change the question
Stop asking where the whole collection is and start asking for the next useful value.
- 02Read
intermediate / 25 min
Context managers encode cleanup
Make resource lifetime visible, exception-safe, and reusable with the context management protocol.
- 03Read
advanced / 26 min
Containers are bundles of protocols
Design collection behavior by choosing iteration, membership, sizing, indexing, and mutation deliberately.
- 04Read
advanced / 26 min
Callable objects and function-like behavior
Use the call protocol to combine behavior with explicit state without pretending every callable is a function.
- 05Read
advanced / 27 min
Structural typing meets runtime protocols
Use typing protocols, ABCs, and capability checks without confusing static compatibility with runtime proof.