Skip to content

Commit

Permalink
Add documentation examples for overridden-final-method checker
Browse files Browse the repository at this point in the history
  • Loading branch information
mbyrnepr2 committed Mar 31, 2022
1 parent cb9dc79 commit 09aa0aa
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/data/messages/o/overridden-final-method/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from typing import final


class Base:
@final
def my_method(self):
pass


class Subclass(Base):
def my_method(self): # [overridden-final-method]
pass
1 change: 1 addition & 0 deletions doc/data/messages/o/overridden-final-method/details.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The message can't be emitted when using Python < 3.8.
12 changes: 12 additions & 0 deletions doc/data/messages/o/overridden-final-method/good.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from typing import final


class Base:
@final
def my_method(self):
pass


class Subclass(Base):
def my_other_method(self):
pass

0 comments on commit 09aa0aa

Please sign in to comment.