On 10.09.2015 06:12, Jukka Lehtosalo wrote:
I am sorry. :)
If I have code without docstrings, I better write docstrings then.
;)
I mean when I am really going to touch that file to improve
documentation (which annotations are a piece of), I am going to add
more information for the reader of my API and that mostly will be
describing the behavior of the API.
If my variables have crappy names, so I need to add type hints to
them, well, then, I rather fix them first.
If I had large untested and undocumented code base (well I actually
have), then static type checking would be ONE tool to find out
issues.
Once found out, I write tests as hell. Tests, tests, tests. I would
not add type annotations. I need tested functionality not proper
typing.
We are problem solvers. So, I would tell my team: "make them faster
and more reliable".
Granted. But you still don't know if your code runs correctly. You
are better off with tests. And I agree type checking is 1 test to
perform (out of 10K).
But:
I didn't see you respond to that. But you probably know that. :)
Thanks for responding anyway. It is helpful to see your intentions,
though I don't agree with it 100%.
Moreover, I think it is about time to talk about this. If it were
not you, somebody else would finally have added type hints to
Python. Keep up the good work. +1
Best,
Sven