.. _using-final-decorator-in-unsupported-version:

using-final-decorator-in-unsupported-version / W2602
====================================================

**Message emitted:**

typing.final is not supported by all versions included in the py-version setting

**Description:**

*Used when the py-version set by the user is lower than 3.8 and pylint encounters a ``typing.final`` decorator.*

**Problematic code:**

.. literalinclude:: /data/messages/u/using-final-decorator-in-unsupported-version/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/u/using-final-decorator-in-unsupported-version/good.py
   :language: python

**Additional details:**

The message is emitted when the ``final`` decorator is used with a Python version less than 3.8.
The ``final`` decorator was introduced in Python version 3.8.

**Related links:**

- `PEP 591 <https://peps.python.org/pep-0591/#the-final-decorator>`_

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