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

# Remove Redundant Constructor in Dict Union

#### Sourcery refactoring id: `remove-redundant-constructor-in-dict-union`

#### Description

#### Before

```python
x = dict(y) | z
```

#### After

```python
x = y | z
```

#### Explanation

The Python dictionary union operator returns a new dictionary, without modifying
any of its operands. As a result, dictionary copies or reconstructions are
unnecessary, and clutter the code.

See also: [`unwrap-iterable-construction`](/reference/refactorings/python/unwrap-iterable-construction/),
[`dict-assign-update-to-union`](/reference/refactorings/python/dict-assign-update-to-union/)
