English
Topic 9. Inheritance, polymorphism, abstract classes, and protocols
Goal: learn to create hierarchies with consistent contracts, use super, ABC, and Protocol, process polymorphic collections, check substitutability, and explain a model with a UML diagram.
Lecture contents
- Inheritance and polymorphism — Inheritance and base classes · Polymorphism and duck typing
- Abstract classes and methods — Abstract classes and methods
- super, protocols, and collection abstractions — Extending behavior with super · Protocols and structural typing · Standard collection abstractions
- Multiple inheritance and composition — Multiple inheritance, MRO, and mixins · Composition and the substitution principle · UML, PyCharm, and testing a hierarchy