> ## 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 Dictionary Keys

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

#### Description:

Removes unnecessary call to `keys()` when iterating over a dictionary

#### Before:

```python
for currency in currencies.keys():
    process(currency)
```

#### After:

```python
for currency in currencies:
    process(currency)
```

#### Explanation:

Sometimes when iterating over a dictionary you only need to use the dictionary
keys.

In this case the call to `keys()` is unnecessary, since the default behaviour
when iterating over a dictionary is to iterate over the keys.

The code is now slightly cleaner and easier to read, and avoiding a function
call will yield a (small) performance improvement.
