R0201
Message
Method could be a function
Description
Used when there is no reference to the class, suggesting that the method could be used as a static function instead
Explanation
If the class method does not reference any of the class attributes it may be more clear to define the method as a static function instead.
Attempt using either of the decorators @classmethod or @staticmethod
Example:
Class Foo(object):
...
def bar(self, baz):
...
return llama
Try instead to use:
Class Foo(object):
...
@classmethod
def bar(cls, baz):
...
return llama
Sometimes I include functions as members in order to encapsulate them with the rest of the class. Is this really a problem?