The @staticmethod is a built-in decorator that defines a static method in the class in Python. A static method doesn't receive any reference argument whether it is called by an instance of a class or by the class itself. The following notation is used to declare a static method in a class:
class person: @staticmethod def greet(): print("Hello!")
In the above example, @staticmethod is applied to the
greet() method. So, the
greet() method can be called using the class name
person.greet(), as well as using the object.
Even though both
p.greet() are valid calls, the static method receives reference of neither.
Hence it doesn't have any arguments - neither self nor cls.