Polymorphism & Abstraction
5 Topics
1
Duck Typing
Python philosophy of behavior-based typing
Python philosophy — tests understanding of dynamic typing, EAFP vs LBYL, and protocol-based design
2
Abstract Classes
Defining interfaces with the abc module
Design patterns — tests understanding of interfaces, abstract methods, and enforcement of contracts
3
Interfaces in Python
ABCs, Protocols, and structural typing approaches
API design — tests knowledge of Python interface options and when to use ABCs vs Protocols
4
Operator Overloading
Custom operators for classes via dunder methods
Advanced OOP — tests understanding of Python data model and when operator overloading is appropriate
5
Protocols (PEP 544)
Structural subtyping for static duck typing
Modern Python typing — tests understanding of structural vs nominal typing and Protocol best practices