For custom type X,
>>> class X(object):
... pass
...
>>> issubclass(X, object)
True
>>> isinstance(X, object)
True
Q) How Xdoes it behave as a subclass and instance object?
>>> issubclass(int, object) # Built-in type
True
>>> isinstance(int, object) # Built-in type
True
Q) How do intthey behave as a subclass and instance object?
>>> issubclass(type, object)
True
>>> isinstance(type, object)
True
Q) How typecan it be both a subclass and an instance object?
>>> issubclass(object, type)
False
>>> isinstance(object, type)
True
objectnot a subclass, but an instance type, which makes sense
>>> issubclass(int, type)
False
>>> isinstance(int, type)
True
>>>
intnot a subclass, but an instance typemakes sense.
>>> issubclass(X, type)
False
>>> isinstance(X, type)
True
also makes sense.
Edit:
here , the message said. The main motivation for introducing new style classes is to provide a single object model with a complete metamodel.
Q) How to understand the meaning of a unified object model?
Q) What is a metamodel?
Q) , type type?