Has anyone had to choose between Mypy and Pyright? Which is "better"? A couple years ago I was in charge of choosing between the two, and I somewhat flippantly chose Pyright because it felt a lot faster ( Later, I realized that some popular libraries we use (django, numpy) have dedicated plugins for Mypy that you can't use with Pyright. So you have to look for Pyright-friendly type stubs or roll your own. I've genera…
pyright and ruff are my new go to python tools, replacing mypy, pylint, isort and black. So far the only thing that bothers me about pyright is that it can't infer the type of collections based on later insertions. So in something like: lst = [] lst.append(1) lst is of type list[Any] I also program in Rust so I kinda expect this to work :P I asked the maintainer about this and this is apparently by design, though myp…
Further, out of the box, ruff doesn't even replace isort. You have to specifically enable it to sort imports (`I`)[^3].
I personally think that ruff's defaults are much too conservative. I configure it with `ALL` and then ignore the rules I don't want. I _want_ upgrades of ruff which add new rules to find new things. I'll never know about the new rules if I have to follow its development. I fully expect `pre-commit autoupdate` to cause me some pain after I run it, and that's okay. Linters adding new rules are usually helping me make my code cleaner.
[^1]: https://docs.astral.sh/ruff/faq/#is-ruff-compatible-with-bla...
[^2]: https://docs.astral.sh/ruff/faq/#how-does-ruff-compare-to-py...