Modern Python design patterns, typing idioms, and language mechanics. Use whenever the user asks about or is working with: Protocol classes and @runtime_checkable, asynccontextmanager exception handling, weakref/WeakMethod behavior, composition roots, ABC vs Protocol selection, or the Builder patter
Modern Python design patterns, typing idioms, and language mechanics. Use whenever the user asks about or is working with: Protocol classes and @runtime_checkable, asynccontextmanager exception handling, weakref/WeakMethod behavior, composition roots, ABC vs Protocol selection, or the Builder pattern vs dataclass. Also triggers for any question involving structural subtyping, garbage collection ti