.. _unnecessary-dict-index-lookup:

unnecessary-dict-index-lookup / R1733
=====================================

**Message emitted:**

Unnecessary dictionary index lookup, use '%s' instead

**Description:**

*Emitted when iterating over the dictionary items (key-item pairs) and accessing the value by index lookup. The value can be accessed directly instead.*

**Problematic code:**

.. literalinclude:: /data/messages/u/unnecessary-dict-index-lookup/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/u/unnecessary-dict-index-lookup/good.py
   :language: python



Created by the `refactoring <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/refactoring/refactoring_checker.py>`__ checker.