.. _use-dict-literal:

use-dict-literal / R1735
========================

**Message emitted:**

Consider using {} instead of dict()

**Description:**

*Emitted when using dict() to create an empty dictionary instead of the literal {}. The literal is faster as it avoids an additional function call.*

**Problematic code:**

.. literalinclude:: /data/messages/u/use-dict-literal/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/u/use-dict-literal/good.py
   :language: python



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