Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Actual static typing and forced type checking.


view as:

I get that you're not particularly excited about gradual typing and the fact that type checkers are optional and live in a separate ecosystem from the interpreter/language runtime.

I actually like the fact that python code without type annotations continues to work as before and allows for easy transcription of ideas into testable code.

If a certain use case requires "forced" type checking, it shouldn't be hard to write a lint rule that disallows code from being committed if there are type checking errors, including missing type annotations.


The issue though is that Python's type annotation is not a substitute for type checking. Annotations are optional and can be inaccurate.

That's fine, this is part of the design of Python. However strict type systems are a benefit of other languages, that may not fit Python. Type annotation shouldn't be considered an alternative to a type system.


Legal | privacy