I'm using abc.abstractmethod:
@abc.abstractmethod
def encode(self) -> bytes:
return NotImplemented
And I get a warning: warning: Returning Any from function declared to return "bytes"
I don't think something is wrong with the code, it's totally normal way to declare and describe an interface and mypy shouldn't complain about it.