Comment by anyfoo

5 years ago

Yes, I've started using python again with mypy static typing. I can hardly still call it a "dynamically" typed language if I do that, though.

The type hints are still just type hints, and have no influence on run time. This can still lead to plenty of scenarios not possible with a compiler.

  • Fair. My point was that I was able to make python "behave more like a statically typed language" to make it bearable, but you're right, it ultimately is still a dynamically typed language at runtime, with the type ultimately bound to the value, and any untyped code still getting away from the "compiler" (which is just a type checker here), to wreak havoc at runtime.

  • You’re right, but in practice the IDE regularly catches type mismatches in my code, and it has been hugely beneficial.

    Then again, I am a fastidious about adding type annotations to my codebase.