What is Duck Type in Python? tccicomputercoaching.com As per Technical Definition: Duck typing in computer programming is an application of the duck test—"If it walks like a duck and it quacks like a duck, then it must be a duck"—to determine if an object can be used for a particular purpose. Actually it is not a python exclusive feature, since almost every dynamic language presents that behaviour.
Duck typing is a feature of a type system where the semantics of a class is determined by his ability to respond to some message (method or property). class Duck: def quack(): print('Quack!') class Goose: def quack(): print('Quack') Goose().quack() >> Quack! Duck().quack() >> Quack!