//
Search across all documentation pages
11 pages in this section.
Why Python's patterns look different from other languages' design patterns - the dynamic object model and dunder-method protocol underneath EAFP, context managers, strategy, and dependency injection - the mental model behind every other page in this section.
The Zen of Python applied to everyday code.
"Easier to ask forgiveness" and when exceptions beat guards.
Resource management, transactions, and temporary state.
Dicts of callables and `singledispatch` over `if/elif`.
Constructing complex objects cleanly.
Decoupling with callbacks, signals, and events.
Avoiding `None` ambiguity with sentinels.
Idiomatic, maintainable design.