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.
Look up more words on Fala2Me
The free English-Portuguese dictionary with real Brazilian accents, NYC slang, conjugator and more
Open Fala2Me →