Duck typing
From Wiki @ Karl Jones dot com
Revision as of 12:16, 29 November 2016 by Karl Jones (Talk | contribs)
In computer programming, duck typing is an application of the duck test in type safety. It requires that type checking be deferred to runtime, and is implemented by means of dynamic typing or reflection.
Description
Duck typing is concerned with establishing the suitability of an object for some purpose. With normal typing, suitability is assumed to be determined by an object's type only. In duck typing, an object's suitability is determined by the presence of certain methods and properties (with appropriate meaning), rather than the actual type of the object.[citation needed] The analogy to the duck test appeared in a Python Enhancement Proposal discussion in 2002.