Summary
ty does not return any error when a class decorated with @final does not implement a inherited abstract method.
The same false negative is observed when class A is a Protocol.
from abc import ABC, abstractmethod
from typing import final
class A(ABC):
@abstractmethod
def foo(self) -> int:
raise NotImplementedError
@final
class B(A): # should error: abstract method foo not implemented
pass
if __name__ == "__main__":
b = B() # should also error
b.foo() # also?
Version
- Python 3.13
- ruff 0.14.13
- ty 0.0.12