Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
adamcharnock
on Feb 25, 2017
|
parent
|
context
|
favorite
| on:
Postmodern Error Handling in Python 3.6
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.
shawabawa3
on Feb 25, 2017
[–]
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: