diff --git a/doc/data/messages/u/using-final-decorator-in-unsupported-version/bad.py b/doc/data/messages/u/using-final-decorator-in-unsupported-version/bad.py new file mode 100644 index 0000000000..59ec6ebc32 --- /dev/null +++ b/doc/data/messages/u/using-final-decorator-in-unsupported-version/bad.py @@ -0,0 +1,8 @@ +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): + ... diff --git a/doc/data/messages/u/using-final-decorator-in-unsupported-version/details.rst b/doc/data/messages/u/using-final-decorator-in-unsupported-version/details.rst new file mode 100644 index 0000000000..6286f94580 --- /dev/null +++ b/doc/data/messages/u/using-final-decorator-in-unsupported-version/details.rst @@ -0,0 +1,2 @@ +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. diff --git a/doc/data/messages/u/using-final-decorator-in-unsupported-version/good.py b/doc/data/messages/u/using-final-decorator-in-unsupported-version/good.py new file mode 100644 index 0000000000..9fe62f8f7c --- /dev/null +++ b/doc/data/messages/u/using-final-decorator-in-unsupported-version/good.py @@ -0,0 +1,3 @@ +class Playtypus(Animal): + def lay_egg(self): + ... diff --git a/doc/data/messages/u/using-final-decorator-in-unsupported-version/related.rst b/doc/data/messages/u/using-final-decorator-in-unsupported-version/related.rst new file mode 100644 index 0000000000..c4a6fafdb3 --- /dev/null +++ b/doc/data/messages/u/using-final-decorator-in-unsupported-version/related.rst @@ -0,0 +1 @@ +- `PEP 591 `_