PY3.W0239
Overridden final method
Used when a method decorated with typing.final has been overridden.
Noncompliant Code:
Copy
from typing import final
class Animal:
@final
def can_breathe(self):
return True
class Cat(Animal):
def can_breathe(self): # [overridden-final-method]
pass
Compliant Code:
Copy
from typing import final
class Animal:
@final
def can_breathe(self):
return True
class Cat(Animal):
def can_purr(self):
return True
Additional details:
The message can't be emitted when using Python < 3.8.