duck typing

[/dʌk ˈtaɪpɪŋ/]
noun
tipagem de pato
1. A programming style that focuses on what an object can do (its behavior) rather than what it is (its type). If it walks like a duck and quacks like a duck, it's a duck.
In Python, duck typing allows you to call any method on an object without checking its type first, as long as the method exists.
Em Python, a tipagem de pato permite que você chame qualquer método em um objeto sem verificar seu tipo primeiro, desde que o método exista.
2. A programming concept where the suitability of an object is determined by the presence of certain methods and properties, rather than the object's inheritance hierarchy or explicit type.
Duck typing is particularly common in dynamically-typed languages like Python, Ruby, and JavaScript.
A tipagem de pato é particularmente comum em linguagens dinamicamente tipadas como Python, Ruby e JavaScript.
Duck typing is a fundamental concept in modern programming philosophy, particularly celebrated in the Python community. The term originated from the phrase 'If it walks like a duck and quacks like a duck, then it must be a duck.' In Brazil and Portugal, the term is often used untranslated in technical communities, though 'tipagem de pato' is the accepted Portuguese translation in formal documentation and education.
Synonyms / Sinônimos
structural typingbehavioral typingprotocol-based typing
Antonyms / Antônimos
static typingnominal typingexplicit type checking

Regional Variations

General Brazilian
tipagem de pato
Standard translation used in Brazilian Portuguese technical literature
Portugal
tipagem de pato
Same term used in European Portuguese programming contexts
Technology Hub (São Paulo)
duck typing
Often used untranslated in tech companies and startup environments

Related Words

dynamic typingtype systempolymorphisminterfaceprotocolmethod resolution

Related Idioms & Phrases

If it walks like a duck and quacks like a duck, then it is a duck
behavior over type
Look up more words on Fala2Me
The free English-Portuguese dictionary with real Brazilian accents, NYC slang, conjugator and more
Open Fala2Me →