Last Updated: May 22, 2026
A mixin is a small class that adds one focused capability to other classes through multiple inheritance. Mixins don't make sense as standalone objects; they're meant to be combined with a "real" class that has the domain data and behavior. The chapter on multiple inheritance introduced the idea briefly. This one covers the pattern itself: what makes a class a mixin (rather than a regular base), how to design one well, where mixins fit alongside composition and decorators, and how the standard library and Django use them at scale.