Files
python/reference/concepts/class_inheritance.md

8 lines
791 B
Markdown
Raw Normal View History

# Class inheritance
TODO: ADD MORE
- The default `__str___` method is inherited from `Object`, which every class in Python inherits from. (See: inheritance) [phone-number](../exercise-concepts/phone-number.md)
- a "subclass" will inherit all methods, attributes from it's parent class, and can then override methods as needed. Overriding means the logic in the parent class is not used. The `super` builtin function (not shown here) exists to allow the programmer to defer logic up the inheritance chain to the parent class when needed. [phone-number](../exercise-concepts/phone-number.md)
- the knowledge of inheritance can be useful in this exercises because all `Exceptions` types inherit from the base class [variable-length-quantity](../exercise-concepts/variable-length-quantity.md)