.. _consider-swap-variables:

consider-swap-variables / R1712
===============================

**Message emitted:**

Consider using tuple unpacking for swapping variables

**Description:**

*You do not have to use a temporary variable in order to swap variables. Using "tuple unpacking" to directly swap variables makes the intention more clear.*

**Problematic code:**

.. literalinclude:: /data/messages/c/consider-swap-variables/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/c/consider-swap-variables/good.py
   :language: python



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