Can a python class call instance methods?
Instance methods. Except for static methods and class methods, all other methods of a class are instance methods.
Instance methods need to be called after instantiating the class. If you use the class to directly call the instance method, you need to explicitly pass in the instance as a parameter.
Related recommendations: "Python Video Tutorial"
The parameter self passed in on the leftmost side is the instance itself.
1 2 3 4 5 6 7 |
|
The above is the detailed content of Can a python class call instance methods?. For more information, please follow other related articles on the PHP Chinese website!