Open5
読者コミュニティ | Python だけで作る Web アプリケーション(フロントエンド編)
本の感想・指摘・質問などお待ちしています
03 設計方針 - abc.ABC か typing.Protocol か については、PEP 544にてabc.ABCを始めとした抽象クラスを
The problem with them [abc.ABCs] is that a class has to be explicitly marked to support them, which is unpythonic and unlike what one would normally do in idiomatic dynamically typed Python code.
と評した上でProtocolを提案してコミュニティに承認されているので、Protocolのほうがよりpythonicというのが一致した見解のようです。
コメントありがとうございます。
Protocolのほうがよりpythonicというのが一致した見解のようです。
おー、そうなんですね!
PEPで示されているなら安心できますね。
参考になりました。ありがとうございます!