When studying Python, you inevitably face the problem of choosing between static methods ( ), class methods ( ), and functions. In this article, I would like to deal with this issue. @staticmethod @classmethod module-level From a technical point of view, the only difference between static and class methods is that the class method gets the class as the first argument. Consider a simple example: class Number: def __init__(self, value): self.value = value @classmethod def multiply(cls, x, y): return cls(x*y) @staticmethod def divide(x, y): return Number(x // y) In this example, the Number class has two methods: a class method and a static one . And we can successfully call both of these methods and it will all work. multiply divide >>> n = Number.multiply(1, 2) >>> n.print() 2 >>> type(n) <class '__main__.Number'> >>> n = Number.divide(2, 1) >>> n.print() 2 >>> type(n) <class '__main__.Number'> But what will happen if an inheritance is used? For example: class Real(Number): pass The class will inherit all the methods of , but when we access the method, we will not get exactly what we might expect. Real Number divide >>> r = Real.multiply(1, 2) >>> r.print() 2 >>> type(r) <class '__main__.Real'> >>> r = Real.divide(2, 1) >>> r.print() 2 >>>type(r) <class '__main__.Number'> As we can see, the method will return a instance instead of . To solve this problem, -s are just right. divide Number Real @classmethod class Number: def __init__(self, value): self.value = value @classmethod def divide(cls, x, y): return cls(x // y) def print(self): print(self.value) class Real(Number): pass >>> r = Real.divide(2, 1) >>> r.print() 2 >>>type(r) <class '__main__.Real'> So when is it better to use a class method, when a static method, and when a module-level function? I believe that if a function needs access to a class, then it is a class method, if it does not need access to either the class or an instance of the class, but is logically related to the class, then it is a static method, otherwise, it is a module-level function.