A static method is a method that uses the @staticmethod decoration, and the parameter table does not require the self or the CLS to access the class member variable
The default method is self, a member method, access to private variables and methods (via SELF.XXX), or access to a class method or variable (through the class name ). Method name or variable name )
Class methods are decorated with @classmethod, and self is not required in the parameter table, but CLS parameters are required to be associated with the current class. You cannot access member variables and methods, but you can access class methods or class variables by cls.xxx
Here is a summary of some of the great gods on the Web:
Static member methods: Cannot access class properties, instance properties, equivalent to an independent method, can understand and the class does not matter, just with the class added a scope, such as: A class, there are three kinds of encryption algorithm, you can consider the static method;
Class member methods: The ability to access class properties, unable to access instance properties, it is important to note that Python is a dynamic language, unlike C + +, instances can be dynamically added properties, that is, the properties of the instance and the properties of the class are not necessarily the same
Python (variable, method) difference between object-oriented (member, Static, Class)