|
|
|
|
|
by f311a
260 days ago
|
|
I think people usually say it for a different reason.
Types are not enforced. You can annotate your code that looks correct to the type checker, but the actual data flow at runtime can be with different types. And it happens quite often in large codebases. Sometimes external dependencies report wrong types, e.g., a tuple instead of a list. It's easy to make such a mistake when a library is written in a compiled language and just provides stubs for types. Tuples and lists share the same methods, so it will work fine for a lot of use cases. And since your type checker will force you to use a tuple instead of a list, you will never know that it's actually a list that can be modified unless you disable type checking and inspect the data. |
|