Skip to content

Commit d11b0c8

Browse files
committed
Add documentation examples for overridden-final-method checker
1 parent cb9dc79 commit d11b0c8

4 files changed

Lines changed: 26 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 Base:
5+
@final
6+
def my_method(self):
7+
pass
8+
9+
10+
class Subclass(Base):
11+
def my_method(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 Base:
5+
@final
6+
def my_method(self):
7+
pass
8+
9+
10+
class Subclass(Base):
11+
def my_other_method(self):
12+
pass
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)