Python Arena

Module 41

Class hierarchies

Classes that build on other classes. A base class holds what several classes share, and derived classes inherit it, add their own attributes and methods, override methods, call the base class's version with super(), and form class hierarchies that isinstance can check.

Steps

  1. Inheriting from a base class
  2. Overriding methods
  3. Calling the base class with super()
  4. Class hierarchies and isinstance