The method defined in class

Function and method of the difference
function: function name directly by calling
method: belongs to a class, the object calls
for an access control method is not provided, similar to the properties of the set
class className (Object):
DEF One (Self):
pass
DEF _TWO (Self):
pass
DEF __three (Self):
pass
. 1
2
. 3
. 4
. 5
. 6
. 7
several decorators
@classmethod: when called, the class name called directly, without calling the object class declaration by indirect
@property: image call call the property the same way, do not write parentheses after the method
----------------

Guess you like

Origin www.cnblogs.com/ly570/p/11408531.html