When defining a method, there is a self parameter, which is used in all method declarations, which represents the instance object itself, when you invoke the method with an instance, the interpreter automatically passes the instance object itself silently to the method, and does not need you to pass self in, For example, there is a method with two parameters, and all of your calls need only pass in two parameters. For example these two files: file name: test.py class a: def abc (self,a,b): a=a+1 b=b+1 file name: test2.py import aa.abc (Print a), btest2.py If you use a A, B, two parameters, you need to pass a A, a two parameter, in addition to these two parameters, but also need to pass, then the self is the other information represented; Instance object: What is an instance object? Instantiate objects you can generally understand the meaning of being quoted ... For example, your father has a car ... Do you want to drive ...? This time, you have to tell your dad that the car lent me to open, and then your father's key to you, you can open it! If you don't say it, you'll never get away with a key.! instantiation of the same meaning, you put a class as an object, as a car, you want to open ... So you and the compiler (that is, the narrow computer) request, Oneclass twoclass=new Oneclass () is a machine borrowed from the grammar, where the side Oneclass and Twoclass is a name difference, For example, your father likes to call his own car dear, then you drive the car, regardless of who, you can call it baby ... Oneclass can't be changed, because you have to tell the machine which car you borrowed ... And then you borrow it and you call it whatever you want .... Class below the method Ah, public properties can be borrowed from, like said the car has four wheels a steering wheel is the property, the method is that the car can be open, can also be inverted open .... So whether you want to be open or upside down, your premise needs to borrow the car to open ... Instantiation is the borrowing of cars ... The calling method is the operation after borrowing the car!   This is instantiation (from Baidu know)
When defining a function in Python, how does self understand: