4 ms·
It's super-easy to use! More flexible than Java, but (so far as I can tell) just as powerful in terms of catching errors.
by scubbo 6y ago
It's super-easy to use! More flexible than Java, but (so far as I can tell) just as powerful in terms of catching errors.
- willcipriano 6y agoYou can even benefit from it without bothering with the type annotations (though they make it more effective). https://google.github.io/pytype/ https://google.github.io/pytype/
- ed25519FUUU 6y agoMaybe your IDE experience is different than mine, but a typed function will gladly accepted an untyped var without complaining, and during runtime could care less.
- j88439h84 6y agoThat's a mypy setting
- anentropic 6y agoThere is type inference in all of the Python type checkers, it's not necessarily an "untyped" var because it lacks an annotation. Running a type checker in Python is a way to avoid runtime type errors, just like in compiled languages, but without a performance benefit.
- ghostwriter 6y ago> but a typed function will gladly accepted an untyped var without complaining this can be made prohibited by MyPy's --strict flag [1], and enforced with a mypy git pre-commit hook locally, and with a MyPy CI job. [1] https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-strict https://mypy.readthedocs.io/en/stable/command_line.html#cmdo...