30 ms·
Just a couple hours ago, a student asked me what was the type of a parameter in a function I wrote. A type hint would have answered their question immediately
by hoosieree 5y ago
Just a couple hours ago, a student asked me what was the type of a parameter in a function I wrote.
A type hint would have answered their question immediately (as they were reading the code).
- the_af 5y agoYes, but checked type annotations will do the same, plus they are actually enforced. An unenforced type hint is just like any comment: likely to get out of sync with the code, and a human must do all the work of keeping it up to date.