PY3.W2602

Using final decorator in unsupported version

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

Noncompliant Code:

Copy
from typing import final

@final  # [using-final-decorator-in-unsupported-version]
class Playtypus(Animal):
    @final  # [using-final-decorator-in-unsupported-version]
    def lay_egg(self):
        ...

Compliant Code:

Copy
class Playtypus(Animal):
    def lay_egg(self):
        ...

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.

The content on this page is adapted from the Pylint User Guide, Copyright ©2003-2022, Logilab, PyCQA and contributors. All rights reserved. https://pylint.pycqa.org/en/latest/index.html#, and is used under the Python Software Foundation License Version 2. Examples, recipes, and other code in the Pylint documentation are additionally licensed under the Zero Clause BSD License.