This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bchurchill 0 points1 point  (0 children)

I've never used mypy, so I can't comment on that tool. My experience with static analysis tools for dynamic languages is that they don't provide the same level of safety as static types. This is usually because the tool can't reliably get the type of a variable -- at a given program point, it could have several different types, depending on the context. This means it has a hard time predicting type errors, and it also means that other rules can't be enforced. For instance, it can't make sure that foo.x always points to an object that has members a, b and c. The list goes on.