AI engineering glossary · Python advanced
What is subclass?
Subclass (also called Child class, Derived class): A class that inherits from another class, gaining its behaviour and adding or changing parts. Objects of a subclass can be used wherever the parent class is expected. It is the counterpart of a parent class in an inheritance relationship.
Subclass: an example
class ElectricCar(Car) is a subclass; an ElectricCar object still answers to Car methods like drive().
Related terms
- Superclass
- Inheritance
- Method overriding
- isinstance
More Python advanced terms
Where you learn it
Subclass is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.