3 ms·
Why add static typing to a language long stood for duck typing? There should really be one way to write in Python.
by yeukhon 10y ago
Why add static typing to a language long stood for duck typing? There should really be one way to write in Python.
- coderzach 10y agoI've had great experiences with optional static typing from tools like flow[1] and mypy. I've found you can gain most of the bug catching and readability benefits of static typing, while having the power of dynamic typing when come across a truly dynamic problem.
- srean 10y agoA few things. i) its not a type checker. It cannot actually ensure type correctness. So may be a more appropriate description would be "a very smart linter". ii) Its optional iii) even when switched on it does nothing unless you are explicitly using its features iv) The "there is only one way to do things in Python" is just vapid marketing. It is not true and has never been true.
- dagw 10y ago"there is only one way to do things in Python" is just vapid marketing. It's not even that, the actual quote is "There should be one, and preferably only one, obvious way to do things". The whole "there is only one way to do it" was a joke response to Perl's "There's more than one way to do it" motto.
- antod 10y agoThe explicit version: "There should be an obvious way to do something. Ideally only one way will be obvious." The original version was too implicit. Unless you are Dutch.