A method, a function attribute of a class, can be declared static if it cannot possibly use the first argument, the instance of a class. Defining a function with an unused parameter/bug is generally a bad idea. If the lack of use is a bug, because the argument should be used, then that should be fixed. If the lack of use is not a bug, then (in general), the parameter should be removed from the header.
What PyCharm should also suggest, if the non-use is not a bug, is removing the function from the class and the unused self parameter from the definition, so that it can be called without needing an irrelevant class instance. Python is not Java. Python used modules rather than classes as the default function container. Example:
def C:
def fmeth(self, x):
def ffunc(x):
return x * 3 + 2
print(C().fmeth(0), ffunc(0)
Except in some special cases, nothing is gained by requiring that the function be accessed through a C instance.
The Python stdlib makes almost no used of staticmethod()
. Except for tests, there are only about 20 uses, and the ones I checked can be seen as special cases. Guido van Rossum has said that the addition of staticmethod
along with classmethod
was questionable and that it should not be used much.