We really ended up with a map of different kinds of Python objects in the last chapter.
Here we also unravel the mystery of the vertical grey lines. They just segregate objects into three spaces based on what the common man calls them - metaclasses, classes, or instances.
Various pedantic observations of the diagram above:
Dashed lines cross spacial boundaries (i.e. go from object to meta-object). Only exception is
<type 'type'>(which is good, otherwise we would need another space to the left of it, and another, and another...).
Solid lines do not cross space boundaries. Again,
<type 'object'>is an exception.
Solid lines are not allowed in the rightmost space. These objects are too concrete to be subclassed.
Dashed line arrow heads are not allowed rightmost space. These objects are too concrete to be instantiated.
Left two spaces contain types. Rightmost space contains non-types.
If we created a new object by subclassing
<type 'type'>it would be in the leftmost space, and would also be both a subclass and instance of
Also note that
<type 'type'> is indeed a type of all types, and
<type 'object'> a superclass of all types (except itself).