Hey there. I'm the author of Robust Python, and the first quarter of my book is all about type hinting, so suffice to say I've thought about it a lot. What follows is strictly my opinion on things. I absolutely agree that there needs to be a balance between verbosity and clarity. Obvious things such as some variable names probably don't need to be annotated, but I think we disagree with what an obvious name is. When…
I just read your book this last week and loved it! I came here to recommend it. One thing I still struggle with, though your book helped a lot, is when you start trying to get typing right with decorators and other types of misdirection. You pretty quickly start reading through PEPs and forums and using weird hacks that may or may not be a good idea. For example, I’ve spent a fair amount of time trying to get PyCharm…
Re: Ask HN: Let's discuss Python type hints guidelines
#11Relax. Per my understanding, you don't need to push yourself so hard. I come from C/C++/Java first. Then I use python. When I learn python, everyone said that the good part of python is its duck type and dynamic type. Now everyone talked about type hints. I can't express my feeling about it. Per my experience, type hints can improve your code quality if you are working with huge code base or some complex project. However, if you just write some scripts to auto some daily tasks, using type hints is a kind of over-skill.