I love me some python, it's my favorite and most-versed language by miles, but typescript definitely gets the W when it comes to its type system. Idk exactly why - both js and python "bolted on" their type systems (syntactic superset), both are highly dynamic, yet python really struggles with typing systems and JITing. I think python is simply "more dynamic" than js. Js has a much simpler data model.
> I think python is simply "more dynamic" than js. Js has a much simpler data model.
I don't think it has much to do with that. There are some major differences between TypeScript and typed Python that explain why TS is so successful and typed Python is not:
1. TypeScript is its own programming language with its own syntax. Even though it's a superset of JavaScript, this still matters. The only special, type-related syntax Python supports is type annotations; defining and otherwise using types is done via Python's normal syntax, which is not very ergonomic or intuitive.
2. Microsoft invested a ton of engineering effort into TypeScript. The Python ecosystem simply has not received that large of an investment in static typing.
3. The Python programming language does not dictate how type checking should be done, so engineering effort is scattered across several projects like MyPy and Pyright. By contrast, TypeScript has essentially "won" that battle on the JavaScript side. (I know Flow exists, but I don't know anyone who uses it for new projects today—everything is done with TS.)