Inheritance
Inheritance is a way through which we create hierarchies in the objects, going from the most general to the most specific. A class that usually forms the base for another class is also known as a base class, whereas a class that inherits from a base class is known as a child class. For example, if a class B derives from class A, then we will say that class B is a child class of class A.
Just like C++, Python supports the concept of both multiple and multilevel inheritance, but does not support the use of access modifiers while inheriting in a class that C++ supports.
Let's take a look at how inheritance can be achieved in Python by trying to model how a new request will look in our BugZot application. The following snippet gives ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access