Guido van Rossum
๐ค SpeakerAppearances Over Time
Podcast Appearances
Maybe there's a typo somewhere else where you meant to use it, but you accidentally used something else, or there are a number of sort of common scenarios.
And a linter is often,
a big collection of little heuristics where by looking at the combination of how your code is laid out, maybe how it's indented, maybe the comment structure, but also just things like definition of names, use of names, it'll tell you likely things that are wrong.
And in some cases, linters are really style checkers.
For Python, there are a number of linters that check things like, do you use the PEP8 recommended naming scheme for your functions and classes and variables?
Because classes start with an uppercase and the rest starts with a lowercase.
There's slight differences there.
And so the linter can tell you, hey, you have a class whose first letter is not an uppercase letter.
And I just find it annoying.
If I wanted that to be an uppercase letter, I would have typed an uppercase letter.
But other people find it very comforting that if the linter is no longer complaining about their code, that they have followed all the style rules.
Yeah, there's definitely that.
But the best use of a linter is probably not so much to sort of enforce team uniformity, but to actually help developers...
catch bugs that the compilers, for whatever reason, don't catch.
And there's lots of that in Python.
But a static type checker focuses on a particular aspect of the linting, which, I mean, MyPy doesn't care how you name your classes and variables.
But it is meticulous about when you say that there was an integer here and you're passing a string there, it will tell you, hey, that string is not an integer.
So something's wrong.
Either you were incorrect when you said it was an integer or you're incorrect when you're passing it a string.
Well, Microsoft is hoping that Microsoft's horse in that race called Pyrite is going to win.