You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vary independent behaviors without one subclass per combination of them.
symptoms
subclass explosion
FilteredSocketLogger-style names
M x N class combinations
mixin soup
verdict
pythonic
caveats
Multiple inheritance, mixins, and dynamically built classes are the guide's 'dodges' — they postpone the explosion instead of ending it.
Each independent axis of variation should become its own small object, injected where needed.
stdlib_sightings
logging.Logger
logging.Handler
logging.Filter
Composition Over Inheritance
One small piece per axis of variation, composed at a single point: M + N
pieces instead of M × N subclasses. Verdict: pythonic — the most
load-bearing idea behind the rest of this catalog.