> ## 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.

# Merge Assignment and Augmented Assignment

#### Sourcery refactoring id: `merge-assign-and-aug-assign`

#### Description:

Replaces an assignment and an augmented assignment with a single assignment.

#### Before:

```python
other_value = 33
number = 42
number += other_value
```

#### After:

```python
other_value = 33
number = 42 + other_value
```

#### Explanation:

When we mutate a variable multiple times without reading or writing its value in
between, it's more readable and more efficient to change its value only once.
This way, it's clearer which values this variable can have at various points.

This refactoring works with all 4 augmented assignment operators:

- `+=`
- `-=`
- `*=`
- `/=`
