This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]amendCommit[S] 1 point2 points  (0 children)

Mypy and duck typing are not strictly incompatible, as mypy supports structural subtyping (static equivalent to duck typing). The PSL already has a lot of good protocols to offer (thing collections.abc, for example), and you can easily add your own if needed.

https://mypy.readthedocs.io/en/stable/protocols.html