+ 4
What is duck typing?
It is difficult to really understand and become familiar with OOP. When I did revisions of OOP, I was often faced with the word âduck typingâ. I canât realize the meaning of the word very well. What is duck typing? What is the difference between duck typing and not? If possible, would you explain it with some examples in Python? This is not urgent. Please post when you feel like. Thanks.đ
6 Answers
+ 2
BlazingMagpie
Thank you very much.
From the viewpoint of specification of programming language, does it mean unnecessity of object type declaration, doesnât it?
Come to think of it, some language requires declaration of object type at all times.
I confused with the style of programming at programmer side.
Thanks!
+ 4
Duck typing basically means that you can try using methods of objects without knowing the type of object. You can just tell object to fly and it will try to, but if it can't, you get error.
+ 2
It seems like Iâm still barking up the wrong tree.
Is there another answer?
+ 2
I think I roughly understand it through contents about the template of c++.
Previous answer has been helpful for me. I got a hint. Thanks.
+ 2
Itâs finished.đđđ
+ 2
You know thatâs not all.đđđ