3 ms·
>> Gradual typing is a type system in which some variables and expressions may be given types and the correctness of the typing is checked at compile time [...]
by plonk 4y ago
>> Gradual typing is a type system in which some variables and expressions may be given types and the correctness of the typing is checked at compile time [...]
> This is definitely not what Python is doing.
When I read "compile time", I mentally replace it with "before runtime". There isn't a real compilation step in Python, so it's reasonable to accept static code analysis as part of "compile time" in that definition.
The point is that type annotations will let a static analysis tool make sure that the program is correctly typed. This can be enabled easily in most of the modern IDEs and editors. You could just decide to block the code's deployment in CI/CD if the type checker raises issues, for example.