classmethod()
The classmethod()
function is used to define a method that operates on the class and not on the instance. This function takes one argument, the method, and returns a class method. For example, @classmethod def my_method(cls, arg1, arg2):
would define a class method my_method()
that takes two arguments.