.. _no-self-use: no-self-use / R6301 =================== **Message emitted:** ``Method could be a function`` **Description:** *Used when a method doesn't use its bound instance, and so could be written as a function.* **Problematic code:** .. literalinclude:: /data/messages/n/no-self-use/bad.py :language: python **Correct code:** ``function.py``: .. literalinclude:: /data/messages/n/no-self-use/good/function.py :language: python ``staticmethod.py``: .. literalinclude:: /data/messages/n/no-self-use/good/staticmethod.py :language: python ``use_self.py``: .. literalinclude:: /data/messages/n/no-self-use/good/use_self.py :language: python **Configuration file:** .. literalinclude:: /data/messages/n/no-self-use/pylintrc :language: ini **Additional details:** If a function is not using any class attribute it can be a ``@staticmethod``, or a function outside the class. .. note:: This message is emitted by the optional :ref:`'no_self_use'` checker, which requires the ``pylint.extensions.no_self_use`` plugin to be loaded. Created by the `no_self_use `__ checker.