.. _duplicate-key:

duplicate-key / W0109
=====================

**Message emitted:**

Duplicate key %r in dictionary

**Description:**

*Used when a dictionary expression binds the same key multiple times.*

**Problematic code:**

.. literalinclude:: /data/messages/d/duplicate-key/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/d/duplicate-key/good.py
   :language: python


**Related links:**

- `Python Dictionaries <https://docs.python.org/3/tutorial/datastructures.html#dictionaries>`_
- `Mapping Types — dict <https://docs.python.org/3/library/stdtypes.html#typesmapping>`_

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