.. _self-cls-assignment:

self-cls-assignment / W0642
===========================

**Message emitted:**

Invalid assignment to %s in method

**Description:**

*Invalid assignment to self or cls in instance or class method respectively.*


**Correct code:**

.. literalinclude:: /data/messages/s/self-cls-assignment/good.py
   :language: python

**Additional details:**

You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ !


Created by the `variables <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/variables.py>`__ checker.