> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Swap Variable

#### Sourcery refactoring id: `swap-variable`

#### Description:

Swap variable values with tuple assignment

#### Before:

```python
temp = a
a = b
b = temp
```

#### After:

```python
a, b = b, a
```

#### Explanation:

When trying to swap the values held by two variables, we may avoid using an
extra temporary variable unnecessarily by employing Python's tuple assignment.
As a consequence of this refactoring, the code is not only more concise but also
reflects its intention more clearly.
