News for hackers. Stuff that matters.
Re:Python’s “type hints” are a bit of a disappointment to me by plonk on Friday April 22, 2022 @03:28PM (#31126866)
>> 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.

There are no comments on this comment yet.