Hacker News new | past | comments | ask | show | jobs | submit login

Am I correct in thinking that duck tying and type hinting are not mutually exclusive? Type hinting is not enforced at runtime, so we are still free to pass around whatever we like as long as it behaves as expected.



Correct, although it kind of defeats the point of typing if you ignore type errors.

There is however an Any type which you can use for things you don't need enforced




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: