News for hackers. Stuff that matters.
Re:Statically-typed error handling in Python using Mypy by patrec on Sunday December 08, 2019 @03:41PM (#21738150)
In my case: Yes and yes. Wildly guessing, about 90% of the errors I find at runtime with dynamic languages would would be caught by a sane type system at compile time. If I'm comparing a completely mis-engineered statically typed language such as C++, the compilation overhead may be so bad that for code I'm writing right now feedback can still be faster with the dynamically typed language. But if we're talking interfacing a few bits of unfamiliar and not great dynamically typed code: well I've literally spent several weeks on a project that would have taken me half a day with even bad static typing.
Re:Statically-typed error handling in Python using Mypy by mixmastamyk on Sunday December 08, 2019 @05:14PM (#21738762)
Pyflakes and a test or two will weed out trivial errors right away. Getting to zero errors takes more work however and that's where mypy has a place.
Re:Statically-typed error handling in Python using Mypy by viraptor on Sunday December 08, 2019 @06:48PM (#21739315)
Unfortunately tests in dynamic languages often don't help. I've run into too many issues where dependencies were mocked with parameters the dev thought were expected. (Or were expected in previous version of some library) With time, it all falls apart without real interface checks.
Re:Statically-typed error handling in Python using Mypy by mixmastamyk on Monday December 09, 2019 @12:51PM (#21744708)
Mypy can apply to tests as well. I don't have any noticeably buggy Python programs and have written more than I can count. All this tooling is a great help but is no substitute for minimum of competence and attention.

It's when you want to add features to a codebase you don't understand, when these features shine.