Hello! In python, there is a type hint, but a code like this:
def add(a: int, b: int) -> int: return a + b add('hello', 'world') well done. I know that there are external utilities for type checking, but I don’t understand: why the syntax was added to the language, but there is no check from the box?
After all, external utilities can check without any additional syntax, why so actively such an idea began to be discussed only now.
Something seems to be no more difficult to parse:
#: int, int -> int def add(a, b): return a + b #: [int] li = [1,2,3] In the same js there is a "strict mode", which can be turned on and off at will, it seems to me that this is much more logical. It is clear that they have different tasks, but the situations seem to be similar.