Skip to content

Commit 4cc1d8d

Browse files
mbyrnepr2Pierre-SassoulasDanielNoord
authored
Add documentation for using-final-decorator-in-unsupported-version (#6583)
Co-authored-by: Pierre Sassoulas <[email protected]> Co-authored-by: Daniël van Noord <[email protected]>
1 parent f4d42c8 commit 4cc1d8d

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from typing import final
2+
3+
4+
@final # [using-final-decorator-in-unsupported-version]
5+
class Playtypus(Animal):
6+
@final # [using-final-decorator-in-unsupported-version]
7+
def lay_egg(self):
8+
...
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The message is emitted when the ``final`` decorator is used with a Python version less than 3.8.
2+
The ``final`` decorator was introduced in Python version 3.8.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Playtypus(Animal):
2+
def lay_egg(self):
3+
...
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- `PEP 591 <https://peps.python.org/pep-0591/#the-final-decorator>`_

0 commit comments

Comments
 (0)