3 ms·
Also note that while this repo might look like a third party bolton (it started that way), the type hinting syntax is nowadays actually integrated in the langua
by Too 4y ago
Also note that while this repo might look like a third party bolton (it started that way), the type hinting syntax is nowadays actually integrated in the language.
The only thing you need to do is add appropriate type hints at function definitions and then run mypy in your build and CI and you got something that checks basically as strict as Java.
For those saying it’s optional so can’t be trusted, consider that compiling C++ with -Wall -Werror is also optional… adding it is simply part of standard project hygiene.
- cercatrova 4y agoPylance in VSCode also errs on type mismatches.
- mdaniel 4y ago> The only thing you need to do is add appropriate type hints at function definitions and then run mypy in your build and CI and you got something that checks basically as strict as Java. There's another comment making this claim elsewhere and I wonder if perhaps those assertions are coming from someone who doesn't write Java, or if my experience with mypy is just especially bad I'll also point out that easily 90% of my heartburn with trying to typehint python in legacy projects is that python seems to encourage so much introspection and namespace trickery. It feels to me like the mypy audience is saying "well, there's a staticly typed language hiding in python so just don't use unsafe parts of the language and you'll be fine"
- nielsbot 4y agoIf it's anything like TypeScript, you can add type documentation for all the tricks.