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.

Correct code:

a = 1
b = 2

a, b = b, a

Problematic code:

a = 1
b = 2

temp = a  # [consider-swap-variables]
a = b
b = temp

Created by the refactoring checker.