.. _consider-using-augmented-assign:

consider-using-augmented-assign / R6104
=======================================

**Message emitted:**

Use '%s' to do an augmented assign directly

**Description:**

*Emitted when an assignment is referring to the object that it is assigning to. This can be changed to be an augmented assign.
Disabled by default!*

.. caution::
  This message is disabled by default. To enable it, add ``consider-using-augmented-assign`` to the ``enable`` option.


**Problematic code:**

.. literalinclude:: /data/messages/c/consider-using-augmented-assign/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/c/consider-using-augmented-assign/good.py
   :language: python




.. note::
  This message is emitted by the optional :ref:`'code_style'<pylint.extensions.code_style>`
   checker which requires the ``pylint.extensions.code_style`` plugin to be loaded.

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