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

# Replace Dict Items with Values

#### Sourcery refactoring id: `replace-dict-items-with-values`

#### Description:

Replace calls to
[`dict.items`](https://docs.python.org/3/library/stdtypes.html#dict.items) with
[`dict.values`](https://docs.python.org/3/library/stdtypes.html#dict.values)
when the keys are not used.

#### Before:

```python
for key, value in d.items():
    print(value)
```

#### After:

```python
for value in d.values():
    print(value)
```

#### Explanation:

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