Re:Python’s “type hints” are a bit of a disappointment to me
by kadoban on Thursday April 21, 2022 @10:13PM
(#31117481)
The types on stitty-documented code often do depend on the types actually being checked though. Otherwise you need to author to be diligent in their types, but if they're bad in their other docs, that seems unlikely.
[ Parent
| on HN ]
Re:Python’s “type hints” are a bit of a disappointment to me
by tjoff on Friday April 22, 2022 @02:09AM
(#31118735)
You don't think that "the author thought that this function would return X, but I got Y" is useful?
Re:Python’s “type hints” are a bit of a disappointment to me
by kadoban on Friday April 22, 2022 @11:37AM
(#31122938)
Only for archeological, and maybe sometimes psychological investigations of code.
Re:Python’s “type hints” are a bit of a disappointment to me
by tjoff on Saturday April 23, 2022 @05:07AM
(#31132577)
That line of reasoning doesn't make any sense to me.
If the author / last person who touched the code misunderstood it then there is a 100% chance there is a bug here.
Knowing that off the bat is quite helpful. And it also tells something about the code quality if it is a common occurrence.