October 2018
Beginner to intermediate
466 pages
12h 2m
English
Technically, every class we create uses inheritance. All Python classes are subclasses of the special built-in class named object. This class provides very little in terms of data and behaviors (the behaviors it does provide are all double-underscore methods intended for internal use only), but it does allow Python to treat all objects in the same way.
If we don't explicitly inherit from a different class, our classes will automatically inherit from object. However, we can openly state that our class derives from object using the following syntax:
class MySubClass(object):
pass
This is inheritance! This example is, technically, no different from our very first example in Chapter 2, Objects in Python, since Python 3 automatically ...