.. _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.*


**Correct code:**

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

**Additional details:**

You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ !


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