[Python] Why was there no need (or was there) for a TypeScript for Python? [closed]

Discussão em 'Python' iniciado por Stack, Fevereiro 15, 2025.

  1. Stack

    Stack Membro Participativo

    Edit: My original question was voted to be closed because it was deemed "opinion-based". That was not the intention of the question. I was thinking perhaps there was something unique about JavaScript that its problems had to be solved with a statically-typed language, or perhaps there could have been equally good alternative solutions except that TypeScript happened to be adopted. But I wouldn't know so I asked it here.


    If I understand correctly, TypeScript was invented to catch type errors at compile time that would otherwise only be exposed at runtime in JavaScript, as JavaScript by definition is dynamically-typed.

    I can see how being able to reassign any value to a variable or to create properties on the fly is not practically useful. And when you do, it is probably unintentional and can easily break things in large projects.

    But these problems are not unique to JavaScript. But there are languages X where X have the same shortcomings but never had a widely adopted TypeScript equivalent of X. For concreteness let's say X = Python.

    Am I missing anything or making false assumptions? Did I misunderstand the nature of the problem TypeScript was invented to solve? People do write large projects in Python, and Python does have the shortcomings of JavaScript for large projects, right?

    Continue reading...

Compartilhe esta Página