While they don’t throw exceptions if you pass in the wrong type, they’re nice because of the implicit in-line documentation they provide the user. You know exactly what the method wants and what is going to be returned without having to read through the documentation.
Actually, I think I meant a little of both. It’s nice to not have to search the docstring to know what values you can and cannot assign to method arguments and also what to expect to get when the method returns.
Any update on mypy integration? I’ve seen a number of cases where the type annotations in the codebase are incorrect. In some of these cases, PyCharm is smart enough to highlight the errors for me. Here is an example: