OOP, Dunder Protocols & C3 MRO
Unit 5: OOP, Iterators & Complexity · 9 min read
Instance vs class attributes, @dataclass ergonomics, operator overloading with dunder methods, and how super() walks diamond MRO.
Key Concepts
- Class attribute vs self.attr shadow trap
- __repr__ vs __str__ and rich comparisons
- Cooperative multiple inheritance using super()
- Composition over deep inheritance hierarchies