6 ms·
Sometimes, but maybe you haven't written any tests! Type hints and immediate feedback from mypy are a lot easier than writing unit tests.
by bpshaver 1y ago
Sometimes, but maybe you haven't written any tests! Type hints and immediate feedback from mypy are a lot easier than writing unit tests.
- igouy 1y ago> haven't written any Any! Then maybe the immediate feedback of consistent types conveys a false impression.
- bpshaver 1y agoHard to conceive of a case where that would occur. Can you think of one? The implication of what you're saying seems to be that if you're concerned about some kind of correctness you should be writing unit tests anyway and not being so fussed about type checking in a language like Python. I suppose if you are strictly following TDD that might work, but in all other cases type checks give you feedback much more quickly than unit tests ever can. I guess I don't understand.
- igouy 1y agoAny old math with consistent types and incorrect calculation? (If only we'd diff'd the output with some known result.) No doubt we're at cross purposes. I'm a little surprised that you haven't mentioned — "Program testing can be used to show the presence of bugs, but never to show their absence!" (or existential versus universal quantification).
- bpshaver 1y agoI'm afraid you lost me.