ClassMethod is used to determine the method that works with the class. Classmethod changes the method of calling the method, so it receives the class itself as the first argument. The StaticMethod decorator changes the method in such a way that it does not receive a special first argument. In fact, the static method is similar to the usual function, which is in the body of the class. The class method can gain access to a class state or change it, while the static method cannot access it or change it.
We use static methods to create official functions. In the example below, we use a static method to check whether a person is an adult or not.
#machinelearning #articalIlinTelling #ai #DatAstascience #PROGRAMMMING #TECHNOLOGY #CODING #BIGDATAA
TAGS :
LEAVE A REPLY