News for hackers. Stuff that matters.
Re:Static Duck Typing in Python with Protocols by zbentley on Tuesday November 23, 2021 @01:48PM (#29321594)
In TypeScript, there's no* way to run your code without invoking the type checker, as it has to transpile TS to JS. While you can suppress/reduce the strictness of the checker, you can't avoid it entirely, and opting out takes work.

Python is the opposite; using type annotations for any sort of verification is opt-in exclusively, and not part of the language/runtime itself.

*Yes, there are some direct TS runtimes/compilers, but they aren't how the vast majority of TS code runs.

There are no comments on this comment yet.