3 ms·
> and adds useful documentation for callers and IDEs. THIS. This is why I started using them, along with standardizing my docstrings. Enormously helpful when y
by sgarland 6y ago
> and adds useful documentation for callers and IDEs.
THIS. This is why I started using them, along with standardizing my docstrings. Enormously helpful when you're trying to remember what the function is expecting to just hover it and find out.
- memco 6y agoYes, they are probably most useful to me for the IDE completions and docs as well. Raymond Hettinger gave at least one talk [1] where he discussed how there are tradeoffs: reasons why you might use them and reasons why you might not. At the end of the day you can pass whatever you want to a function and the only reason to use types if they make your code better—but there are other tools that might be more worth your time in some situations. [1]: https://www.youtube.com/watch?v=ARKbfWk4Xyw https://www.youtube.com/watch?v=ARKbfWk4Xyw