Re:Python’s “type hints” are a bit of a disappointment to me
by reikonomusha on Thursday April 21, 2022 @10:17PM
(#31117504)
This is my point precisely: it looks like a static type declaration to anybody who has seen what a static type declaration looks like in any statically or gradually typed program in the last 50 years.
But in Python, it's not (and documented in a PEP as not), and it causes massive confusion.
Re:Python’s “type hints” are a bit of a disappointment to me
by heavyset_go on Friday April 22, 2022 @03:52AM
(#31119279)
That's the way it works in Ruby with RBS, and it will work the same way in JavaScript should Microsoft's proposal for type hints make it into ECMAScript[1].
[1] https://devblogs.microsoft.com/typescript/a-proposal-for-typ...
Absent of active machine checking (e.g., via mypy), type hints should be considered exactly what you said: another form of documentation, one that might just be wrong.