.. _consider-using-set-comprehension:

consider-using-set-comprehension / R1718
========================================

**Message emitted:**

Consider using a set comprehension

**Description:**

*Although there is nothing syntactically wrong with this code, it is hard to read and can be simplified to a set comprehension. Also it is faster since you don't need to create another transient list*

**Problematic code:**

.. literalinclude:: /data/messages/c/consider-using-set-comprehension/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/c/consider-using-set-comprehension/good.py
   :language: python

**Additional details:**

pyupgrade_ can fix this issue automatically.

.. _pyupgrade: https://github.com/asottile/pyupgrade


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