Re:Open-sourcing MonkeyType – Let your Python code type-hint...
by joshuamorton on Friday December 22, 2017 @02:55AM
(#15985919)
By everywhere, I mean where it's otherwise obvious:
Those autos don't need to exist, they're completely inferable, otherwise you wouldn't use auto. It's not like you can use auto in function declarations, nor should you, I agree.
[ Parent
| on HN ]
Re:Open-sourcing MonkeyType – Let your Python code type-hint...
by tjoff on Friday December 22, 2017 @04:14AM
(#15986220)
I always write std::string etc. in those cases. It is consistent and quicker to read and there is not tangible benefit to using auto.
Re:Open-sourcing MonkeyType – Let your Python code type-hint...
by joshuamorton on Friday December 22, 2017 @02:22PM
(#15990135)
Right, but my point is that there's really no tangible benefit to writing the type at all. In a language with good type inference (Haskell, ml, modern python), the string literal is known to be a string, and you don't need to do any extra work.