Each Python class definition has an implicit superclass: object. It's a very simple class definition that does almost nothing.
We can create instances of object, but we can't do much with them, because many of the special methods simply raise exceptions.
When we define our own class, object is the superclass. The following is an example class definition that simply extends object with a new name:
>>> class X: >>> pass
The following are some interactions with this tiny class definition:
>>> X.__class__ <class 'type'> >>> X.__class__.__base__ <class 'object'>
We can see that a class is an object of the class named type and that the base class for our new class is the class named object. As we look at each method, we also take a look at the default behavior...