.. _use-sequence-for-iteration:

use-sequence-for-iteration / C0208
==================================

**Message emitted:**

Use a sequence type when iterating over values

**Description:**

*When iterating over values, sequence types (e.g., ``lists``, ``tuples``, ``ranges``) are more efficient than ``sets``.*


**Correct code:**

.. literalinclude:: /data/messages/u/use-sequence-for-iteration/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/recommendation_checker.py>`__ checker.