pylint-errors

C0201 (consider-iterating-dictionary)

:x: Problematic code:

data = {'x': 1, 'y': 2, 'z': 3}
for key in data.keys():
    pass

:heavy_check_mark: Correct code:

data = {'x': 1, 'y': 2, 'z': 3}
for key in data:
    pass

Rationale:

Emitted when the keys of a dictionary are iterated through the .keys() method. It is enough to just iterate through the dictionary itself, as in for key in dictionary.