Hacker News new | ask | show | jobs
by dzbarsky 3797 days ago
Even if you ignore all the other benefits of type annotations, merely being explicit about the types of parameters your function accepts helps people reading your code.

If you're going to make the argument that you can just add comments with the types - well then that's exactly what mypy is doing, but if you do it in the mypy format you get static analysis of your types for free.

Static typing and unit testing aren't mutually exclusive.