Module 17
Object-Oriented Programming
Learn Python OOP concepts such as classes, objects, inheritance, abstraction, encapsulation, and polymorphism.
01
OOP Roadmap — Classes, Objects, and the Seven Principles
See the Python OOP roadmap: classes, objects, constructors, encapsulation, inheritance, and polymorphism, and why every value is an object.
02
Classes — Programmer-Defined Types in Python
Learn what a Python class is: a programmer-defined type of data members and methods, with no instance memory until you create an object.
03
Inside a Class — Data Members, Methods, self, and cls
See the parts inside a Python class: instance data, class data, instance methods, class methods, static methods, self, and cls.
04
Objects — Instances, Memory, and Many Values from One Class
Create a Python object from a class, compare the class with its instances, and store different instance data in each object.
05
Constructors — __init__, Default and Parameterized
Initialize a Python object with __init__, compare default and parameterized constructors, and use default arguments when you need both.
06
Destructors — __del__ and the Garbage Collector
Learn how Python releases an unused object with __del__, and how del or None asks the garbage collector to run that cleanup.
07
Encapsulation and Abstraction — Hide a Field, Show a Method
Hide a Python instance field with a double underscore, then let callers use a method so they see the result without the stored detail.
08
Inheritance — Reuse a Base Class in a Derived Class
Reuse Python class features with inheritance, create the object from the derived class, and recognize the five inheritance patterns.
09
Polymorphism — One Method Name, Many Forms
Override a Python method so one name has many forms, then call the original body with super() when the child still needs it.