CertGrid CertGrid
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

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.

One machine, and any shell with Python 3 will do - these exams test the language, not a distribution.
Server NameIP AddressOSRolesCPURAMHDD
RUNNER01192.168.0.27Ubuntu 26.04 LTSPython 3.14.4 - the only machine this path needs2 Core4 GB50 GB

Before you start

  1. A subclass gets everything and can replace anything

  2. super, to extend rather than replace

  3. The constructor that forgets its parent

  4. Which class a method was found on

  5. Polymorphism, which is the point of all this

  6. isinstance across a hierarchy

  7. What the exam does with this objective

Official sources