๐Ÿ Design Patterns with Python
Home Chapters Examples Diagrams Bibliography GitHub โ†—
  1. Home
  2. Principles: SOLID
Part 3 2 chapters

Principles: SOLID

The five SOLID principles in Python: single responsibility, open/closed and Liskov substitution, then interface segregation and dependency inversion without a framework.

Chapter 5

SRP, OCP, and LSP in Python

Single responsibility, open-closed and Liskov substitution on one rate quote: three collaborators, a tax rule that arrives as data, and a contract suite for what mypy cannot see.

Read โ†’
Chapter 6

ISP, DIP, and dependency injection without a framework

A consumer names the smallest Protocol it uses, policy owns that abstraction, and one plain function wires the adapters, shown on a runnable booking service.

Read โ†’
โ† Previous part Why Python Is Different Next part โ†’ The Python Substrate
Design Patterns with Python
Prose, diagrams and decks: CC BY 4.0. Sample code: Apache 2.0.
Source on GitHub โ†—  ยท  File an issue โ†—