Duck Typing is an actively used design pattern. In duck typing, an object's suitability is determined by the presence of certain methods and properties, rather than the type of the object itself. Duck typing is similar to, but distinct from structural typing. Structural typing is a static typing system that determines type compatibility and equivalence by a type's structure, whereas duck typing is dynamic and determines type compatibility by only that part of a type's structure that is accessed during run time. Protocols and interfaces can provide some of the benefits of duck typing, but duck typing is distinct in that no explicit interface is defined.
- the Duck Typing wikipedia page
- Have a question about Duck Typing not answered here? Email me and let me know how I can help.
Languages with Duck Typing include python
Last updated August 9th, 2020