It’s easier to maintain in the future, when I don’t have to do so many mental gymnastics to understand the data behind my code.
It’s easier to maintain in the future, when I don’t have to do so many mental gymnastics to understand the data behind my code.
There can be many potential use cases, such as providing typing information to the IDE's LSP, ejecting them directly to the code as you suggested, integrating them into the CI process, etc.
I'm very open to providing all those possibilities, and there's no reason to limit how you use the typing information when you possess them automatically.
There are other reasons to use explicit types part of the time- but they don't really have to do with readability
If you want to constrain the return type so that any errors about bad return-values from this function are localized to it, instead of having them show up further downstream, then that's what I meant by "other reasons to use explicit types"