Pattern: Use of instance method instead of static function
Issue: Instance method could be a static function
The method does not make use of the class instance it gets passed. For clarity, it should be declared as a static method using the @staticmethod
decorator.
Example of incorrect code:
class Foo(object):
...
def bar(self, baz):
...
return llama
Example of correct code:
class Foo(object):
...
@staticmethod
def bar(cls, baz):
...
return llama