#duck-typing

[ follow ]
fromRealpython
1 day ago

Exploring Protocols in Python - Real Python

Protocols allow for structural subtyping in Python, enabling static type checking through tools like mypy, Pyright, and Pyre, overcoming limitations of nominal subtyping.
Python
fromHackernoon
6 years ago

Go Interfaces, Explained for TypeScript Developers | HackerNoon

In TypeScript, interfaces are structurally typed, allowing you to define expected object shapes, whereas Go's interfaces leverage duck typing for behavior without explicit implementation.
Scala
[ Load more ]