#-*-coding:utf-8-*-#Classic class or Old test classclassA:Passa=A ()#New ClassclassB (object):Passb=B ()#Python2 not supported#print (a.__class__)Print(A.__class__)Print(Type (A))Print(Type (a))#Python2#__main__. A#<type ' classobj ' >#<type ' instance ' >#Python3#<class ' type ' >#<class ' __main__. A ' >#<class ' type ' >#<class ' __main__. A ' >PrintB.__class__)Print(b.__class__)Print(Type (B))Print(type (b))#Python2#<type ' type ' >#<class ' __main__. B ' >#<type ' type ' >#<class ' __main__. B ' >#Python3#<class ' type ' >#<class ' __main__. B ' >#<class ' type ' >#<class ' __main__. B ' >#the implementation of the old class is not good enough, the class is a class, the instance is an instance, the class type is classobj, the type of the instance is instance, the relationship between the two is only __class__,#this is different from the built-in object, where the type of the int object is int, and the int () returns an object of type int, and the built-in object and the custom object are different, which brings great difficulty to the unified implementation of the code. ##New Class##1. The types of all classes are type#2. The results of all class invocations are constructed, returning instances of this class#3. All classes are subclasses of object#4. The new class can not only invoke the parent class's method with the old class, but also use the Super method.
from:https://my.oschina.net/shyl/blog/692930
Python Class and Class (object) Usage differences