Inheritance

Inheritance lets a child class take over the attributes and methods of a parent class and extend or override them. super() calls the parent's behavior. It suits relationships of the "is a" type; otherwise, composition is often more appropriate.

Example

class Chat(Animal):
    def parler(self):
        return 'Meow'

Related concepts

The whole glossary