+ 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 ответов
+ 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.👏👏👍