3 ms·
I agree that type hints are basically just "machine-readable documentation" (and human-readable as well!). I still think that machine-readable documentation ca
by realharo 11y ago
I agree that type hints are basically just "machine-readable documentation" (and human-readable as well!).
I still think that machine-readable documentation can be immensely useful when combined with a static code analysis tool. Not as useful as "real" static types would be, but useful nonetheless.
It is the exact same idea as Microsoft's SAL annotations for C/C++ - https://msdn.microsoft.com/en-us/library/ms182032.aspx https://msdn.microsoft.com/en-us/library/ms182032.aspx, or Java's @NonNull, @ReadOnly, etc. annotations.