1. Reflection
2. Built-in methods
__ Name __: Special method/Built-in method in class
Double Subscript Method Magic method
1.__call__
Instantiating an object ()---->> equivalent to executing the __call__ method
Application: Used to view the execution process in the source code
2.__len__ for viewing the length of an object
Len (object), the __len__ method that invokes object does not execute Len () if there is no __len__ error
3.__new__------>>> Construction method
__INIT__------>>> Initialization method
Occurs before the __init__ method is executed after instantiating the object.
1. Creating a space in memory belongs to the object
2. Pass object space to self, execute __init__
3. Returning object space to the caller
The __new__ method is executed after instantiation and then __init, which opens up a new space
Creating a singleton class with the __new__ method
Singleton class: A class that has only one instanced object from start to end
4.__str__ pirnt (object) can print some properties of an object directly
Classes for Python