4 ms·
Go has this "interface" thing which lets you do duck-typing, and it's checked at run-time, as the types in Python.
by jxub 9y ago
Go has this "interface" thing which lets you do duck-typing, and it's checked at run-time, as the types in Python.
- int_19h 9y agoThis is consumer-side duck typing. Python also provides producer-side duck typing - you can make any of your objects a duck dynamically, by making them behave like a duck at runtime. I'm not aware of anything similar in Go wrt interfaces.