.. _subclassed-final-class:

subclassed-final-class / W0240
==============================

**Message emitted:**

Class %r is a subclass of a class decorated with typing.final: %r

**Description:**

*Used when a class decorated with typing.final has been subclassed.*

**Problematic code:**

.. literalinclude:: /data/messages/s/subclassed-final-class/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/s/subclassed-final-class/good.py
   :language: python

**Additional details:**

This message is emitted when a class which is decorated with `final` is subclassed; the decorator indicates that the class is not intended to be extended.

Note this message can't be emitted when using Python < 3.8.

**Related links:**

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

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