Duck Typing is a [type system] used in dynamic languages. For example, Python, Perl, Ruby, PHP, Javascript, etc. where the type or the class of an object is less important than the method it defines. Using Duck Typing, we do not check types at all. Instead, we check for the presence of a given method or attribute.
reference: geeksforgeeks
按上述來說, 鴨子類型是動(dòng)態(tài)語(yǔ)言的特性, 在動(dòng)態(tài)語(yǔ)言中, 類型并不重要, 重要的是類型(實(shí)例)的方法