> ## 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 Dict Items

#### Sourcery refactoring id: `remove-dict-items`

#### Description:

Remove unnecessary calls to `dict.items` when the values are not used.

#### Before:

```python
for name, age in people.items():
    print("Hi, my name is", name)
```

#### After:

```python
for name in people:
    print("Hi, my name is", name)
```

#### Explanation:

Calling
[`dict.items`](https://docs.python.org/3/library/stdtypes.html#dict.items) is
only necessary when both the dictionary keys and values are used. When the
values are not used, it is sufficient to iterate over the dictionary keys only.

The code is now easier to read, avoiding an unnecessary call to `dict.items`,
and removing an unused variable - the dictionary values.
