|
|
|
|
|
by coldtea
1918 days ago
|
|
>I can't help but feel like if you want static typing, you're better off recognizing that python is not the right tool for the job. Static typing is not a job though. It's a language feature. The job is solving technical/business problems. And Python is a tool, but it's not a tool to do dynamic typing or static typing with, it's a tool to solve problems with. So, the comment "if you want static typing, you're better off recognizing that python is not the right tool for the job" doesn't quite sit right. You could instead better say that it's not a good fit for Python. But why would that be? Especially since one could easily have said the same for Javacript, but Typescript exists as basically Javascript + types, and people seem to love it. So there's that. |
|
The extent to which a) is due to implementation decisions made by typescript/mypy vs being due to inherent differences between Javascript and Python is arguable. Certainly there are things that look like unforced design errors in mypy, and the fact that Dart existed (and largely failed) before Typescript shows that it's not just about what language you're based on. But there are also idioms and aspects of the Python object model that seem inherently hard to type nicely, and are sadly too entrenched in the ecosystem to change.