3 ms·
I work with both Python and TS. Python's type hints feel bolted onto the language, whereas TS feels more native. In Python, you have to import a whole bunch of
by rednafi 2y ago
I work with both Python and TS. Python's type hints feel bolted onto the language, whereas TS feels more native. In Python, you have to import a whole bunch of stuff for typing, which adds runtime overhead.
For example, typing a decorator means importing `ParamSpec`, `Callable`, and a bunch of other things. In TS, all of that is available in the global scope, so it’s way less cluttered. Plus, the type system in TS is a lot more powerful. Generic record types are way nicer in TS than in Python.