PEP-544 で導入されたプロトコルの無効な定義と使用箇所を報告します。

例:


from typing import Protocol


class MyProtocol(Protocol):
    def method(self, p: int) -> str:
        pass


class MyClass(MyProtocol):
    def method(self, p: str) -> int: # 'method' の型は 'MyProtocol' と互換性がありません
        pass


class MyAnotherProtocol(MyClass, Protocol): # プロトコルのすべての基底はプロトコルでなければなりません
    pass