3 ms·
In Python, duck typing provides the benefits of generics, minus the static guarantees. If you're using duck typing in python, then you should be able to underst
by smaddox 9y ago
In Python, duck typing provides the benefits of generics, minus the static guarantees. If you're using duck typing in python, then you should be able to understand why generics can be useful.
- dullgiulio 9y agoGo uses structural typing which feels like duck typing but it's actually checked at compile time. That's the reason why the Go community feels generics are not the top priority (euphemism.) Only in very specific cases (implementing data structures, for example) you can feel the need for generics. Maybe also in serialization, although that's really normal to pass a generic container (object, void *, interface{}) and use introspection.