Skip to content

Commit

Permalink
Add documentation for using-final-decorator-in-unsupported-version (#…
Browse files Browse the repository at this point in the history
…6583)


Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
  • Loading branch information
3 people committed May 12, 2022
1 parent f4d42c8 commit 4cc1d8d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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):
...
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Playtypus(Animal):
def lay_egg(self):
...
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- `PEP 591 <https://peps.python.org/pep-0591/#the-final-decorator>`_

0 comments on commit 4cc1d8d

Please sign in to comment.