Skip to main content

All Questions

Filter by
Sorted by
Tagged with
5 votes
2 answers
2k views

Does this code follow duck typing?

The principle of duck typing says that you shouldn't care what type of object you have - just whether or not you can do the required action with your object. For this reason the isinstance keyword is ...
overexchange's user avatar
  • 2,305
23 votes
4 answers
2k views

Why would many duck-typed dynamic programming languages use a class-based approach instead of prototype-based OOP?

Since quite many dynamic programming languages have the feature of duck typing, and they can also open up and modify class or instance methods at anytime (like Ruby and Python), then… Question 1) ...
iceX's user avatar
  • 691