Skip to content

Commit ff5c7e3

Browse files
Add documentation examples for overridden-final-method checker (#6080)
* Add a `pylintrc` to ensure Python version 3.8 is the minimum version used for the `overridden-final-method` documentation test Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
1 parent c4e9afe commit ff5c7e3

5 files changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from typing import final
2+
3+
4+
class Animal:
5+
@final
6+
def can_breathe(self):
7+
return True
8+
9+
10+
class Cat(Animal):
11+
def can_breathe(self): # [overridden-final-method]
12+
pass
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The message can't be emitted when using Python < 3.8.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from typing import final
2+
3+
4+
class Animal:
5+
@final
6+
def can_breathe(self):
7+
return True
8+
9+
10+
class Cat(Animal):
11+
def can_purr(self):
12+
return True
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[testoptions]
2+
min_pyver=3.8
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/>`_

0 commit comments

Comments
 (0)