bigonotes
CS ConceptsOOP

OOP

Classes, objects, inheritance and polymorphism, with Python examples.

11 notes · 40 min total

  1. 1Classes and ObjectsAudioWhat classes and objects are in Python, where attributes live, and how __new__ and __init__ build an object.4 min
  2. 2Class Keywords and ConceptsHow self, class attributes, static and class methods, Final, super() and access conventions work in Python classes.5 min
  3. 3EncapsulationAudioHow to hide an object's data and control access to it in Python with naming conventions, getters/setters and @property.3 min
  4. 4AbstractionAudioHow abstraction hides implementation behind a contract, and how Python's ABC and @abstractmethod enforce it.3 min
  5. 5InheritanceAudioHow Python classes reuse code through inheritance, how super() and the MRO work, and how the diamond problem is resolved.4 min
  6. 6PolymorphismAudioHow one interface can behave differently per object in Python: duck typing, method overriding and operator overloading.2 min
  7. 7Relationships: Association, Aggregation, CompositionHow classes relate (is-a vs has-a), and how to tell association, aggregation and composition apart in UML and code.3 min
  8. 8Dunder Methods and @propertyAudioWhich dunder methods Python calls for printing, comparing, adding and len(), and how @property gives computed attributes.4 min
  9. 9DecoratorsHow Python decorators wrap functions, and when to use @classmethod, @staticmethod, @property, @dataclass and your own.4 min
  10. 10OOP Principles RecapA one-page Python recap of the four OOP pillars plus abstract base classes vs protocols, tying the OOP lessons together.4 min
  11. 11OOP Practice ExercisesThree Python exercises (library, animals, bank) that combine dunder methods, abstraction, encapsulation and Singleton.4 min