3 ms·
"VSCode’s Python support works fine with or without type hints in user code. Obviously, you get more value with them, but that's because there is more informati
by wheelerof4te 5y ago
"VSCode’s Python support works fine with or without type hints in user code. Obviously, you get more value with them, but that's because there is more information to work with."
How can I avoid type hints when my IDE is "smarter" now with them? When they changed it's linter to look for type hints and ignore the rest of the code in functions in order to determine types?
Sure, it is easier for IDE developers to just leverage type hints and ignore the context of the entire script. But, what does that mean? Am I now required to type hint my functions just to make use of my IDE's features? It is certainly implied.
Sure, you can use VS Code without type hints. But that would be like playing Guild Wars 2 without in-game purchases. Possible, but much harder and you would be outplayed by a lot of top ranked players.
- dragonwriter 5y ago> How can I avoid type hints when my IDE is "smarter" now with them? Accept that the IDE won't be smarter for the kind of code you are writing. > When they changed it's linter to look for type hints and ignore the rest of the code in functions in order to determine types? Oh, so you mean “now that my IDE changed to be dumber without them than it used to be”. Don't use that IDE. Or complain to them to fix it. Or choose a non-default linter, if it supported. (IDEs can be very opinionated about how languages will be used, but to the extent that this conflicts with your preferences, complaining that the language shouldn't support something because the IDE you were using decided to only support that approach is blaming the wrong party.) > Sure, it is easier for IDE developers to just leverage type hints and ignore the context of the entire script. Python has lots of available linters, and most of them don't do that (you can't correctly apply type hints of you do, so its a bad idea even with type hints.) If a linter does that, don't use that linter. If an IDE mandates exclusively using a linter that does that, don't use that IDE. > Am I now required to type hint my functions just to make use of my IDE's features? I don't know about your IDE. Mine works as well as it ever did (well, better, as it is continually improving) on non-hinted code, and even better than that with with hinted code.