typing.Protocol
Duck Types and Protocols によると、Protocolは静的なダックタイピング
https://docs.python.org/ja/3/library/typing.html#typing.Protocol
プロトコルクラスの基底クラス。
Protocolを継承して独自のプロトコルを定義する
独自のプロトコルは型ヒントに使える
型チェッカ向け
このようなクラスは主に構造的部分型 (静的ダックタイピング) を認識する静的型チェッカーが使います。
https://docs.python.org/ja/3/library/typing.html#typing.runtime_checkable
Mark a protocol class as a runtime protocol.
isinstanceやissubclassと合わせて使われる
runtime_checkable() will check only the presence of the required methods, not their type signatures.
「要求されるメソッドの存在だけを見る」
「シグネチャまでは見ない」
PEP 544 – Protocols: Structural subtyping (static duck typing)