Objects and design Five lessons that keep your code tidy as it grows: data and functions together in one "object", reuse through inheritance, then drawing your design before you write it and meeting the best-known design patterns.
Lessons 0 Overview Five lessons that take you from the function to the class: the object and its state, inheritance and polymorphism, abstract contracts, then drawing your design in UML and applying the three best-known design patterns. 1 Classes & the Object Model Building your own type, how a class differs from an object, and what __init__ and self actually do in memory. 2 Inheritance & Polymorphism How one class inherits another's behaviour and overrides only what it needs, and why “is it a kind of?” decides whether inheritance belongs at all. 3 Abstract Classes & Interfaces Enforcing a contract on everyone who inherits from you, how an abstract class differs from an interface, and why Python refuses to instantiate an abstract one. 4 UML Modeling Everything you need to understand about UML Class Diagrams and Sequence Diagrams, the six relationships between classes, with Python examples and ready-made Mermaid diagrams. 5 Design Patterns in Python Factory, Observer, and Decorator, three classic solutions to three recurring design problems, with complete Python examples and UML diagrams illustrating each pattern's structure. 6 Wrap-up and resources The best outside resources for these lessons, classified by kind and level. All are open to everyone and need no account on any platform. Use the filters to narrow the list.