Concepts·Certified Associate Python Programmer
Python Inheritance and Method Overriding
PCAP objective 4.5 is build a class hierarchy using inheritance. A subclass gets everything its parent has and may replace any of it. `super()` calls the parent's version, which is how you extend rather than replace. The examinable trap is a subclass `__init__` that does not call `super().__init__()`: the object is created perfectly happily, missing attributes, and fails somewhere else entirely.
Object-Oriented Python Guide 18 of 25 Intermediate
- Python3.14.4
- OSUbuntu 26.04 LTS
- pip25.1.1
- TimeAbout 17 min
- Reviewed23 August 2026
Written against the versions above. `super()` with no arguments is Python 3 only. The Python 2 form `super(Child, self)` still works and is never necessary. Both appear in older material.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| RUNNER01 | 192.168.0.27 | Ubuntu 26.04 LTS | Python 3.14.4 - the only machine this path needs | 2 Core | 4 GB | 50 GB |
Before you start
-
A subclass gets everything and can replace anything
-
super, to extend rather than replace
-
The constructor that forgets its parent
-
Which class a method was found on
-
Polymorphism, which is the point of all this
-
isinstance across a hierarchy
-
What the exam does with this objective