3 ms·
> some of the Mypy maintainers Ah, fair enough. Still, I hadn't realized that! > Do people not run tests much in more-static languages? You do, but the tests
by DonaldPShimoda 7y ago
> some of the Mypy maintainers
Ah, fair enough. Still, I hadn't realized that!
> Do people not run tests much in more-static languages?
You do, but the tests you need are different. You don't need to test that all inputs are valid by type (checking for runtime type errors in Python, for example), because type correctness is guaranteed when you compile.
So instead, you just have to write tests for functionality.
In a dynamically typed language, you need both to really ensure you're covered. (Or else you're just relying on invariants that people obey, which is... risky.)
> `typing.Protocol` is in Python 3.8.
Ah! Excellent. Glad to hear it! I will certainly be making use of that haha.