What is the difference between the new class and the classic Python class is

The new class Old class
Breadth-First Depth-first
Python 3.x default are the new class (object can not write) Python 2.x default is classic class, only inherited the object is explicitly new class
Method new class built __new__ Classic not only __new__ method __init__ method
__new__ method prior to __init__ method is called in the instance creation process, it's the first argument of type type.
Published 478 original articles · won praise 673 · views 190 000 +

Guess you like

Origin blog.csdn.net/YJG7D314/article/details/104002868