3 ms·
Type hints are an absolute must for me in modern Python, starting with one really simple reason: All the tooling can use them. That means: - The static ch
by usrbinbash 3y ago
Type hints are an absolute must for me in modern Python, starting with one really simple reason: All the tooling can use them.
That means:
- The static checker / linter
- My LSP server
- Documentation Generators
- Testing frameworks
All of them can use type hints to work better, or to put this in to words that interest me: make my life easier. Laziness is a programmers virtue. I am lazy. I don't want to guess or lookup what type a param has. I want my LSP to yell it at me loudly when calling something. Taking the 1.5 extra seconds to write that type hint, is a minute saved later when using the code.
Oh, and to everyone using LLM in their editing environment: They understand type hints as well, and can make good use of them.
And for when I am feeling especially lazy: I have a keybind that sends the current code block to the LLM asking it to add type hints and a docstring ;-)
- jpc0 3y agoThere is also improving support with tools like cython.