pyright is state of the art right now thanks to eric. If you use VSCode+Pylance you will feel right at home coming from Rust/TS. just be aware a lot of community packages aren't ready for typed python. if you stick to the good stuff like fastapi and pydantic, you will be fine.
Ask HN: Which Python type checker should I use?
41–50 of 83 posts
Re: Ask HN: Which Python type checker should I use?
#42Earlier quoted context omitted.
I think you are reading far too much into their comment. I agree that their comment could have benefited from some elaboration but the simple act of them expressing their opinion (especially one that is not seen in the rest of the thread, as of my writing this comment) is a "helpful contribution to the debate", in my opinion.
Given no other context, it's not very helpful
Re: Ask HN: Which Python type checker should I use?
#43Re: Ask HN: Which Python type checker should I use?
#44Pyright is the Microsoft provided lsp: does anyone else feel uneasy about using this? Especially given the EEE playbook "that we definitely won't do this time" - would love to have a discussion on this if someone could talk me into using it. I just use a combination of black, flake, and mypy. Apparently ruff is quite good as well. For lsp I use Jedi, which actually worked faster on my company's code base than pyright…
How do you imagine that EEE could be applied to a type checker?
1. Make a really great type checker.
2. Make it difficult to use in IDEs other than VSCode.
3. Everyone uses VSCode.
I don't care though. Pyright is fantastic and giving it away for free is amazing even if it is part of a plan to push people to VSCode.
Re: Ask HN: Which Python type checker should I use?
#45If it's new code, Pyright hands down.
Re: Ask HN: Which Python type checker should I use?
#46The only useful types to add are Cython 3, otherwise adding more letters with no benefit reduces readability and reminds me of “public static void main”.
Re: Ask HN: Which Python type checker should I use?
#47I would not personally use any of them. Typed python in previous workplace was pretty much shitshow, and if starting from scratch instead of untyped codebase it might be worth it, maybe, for some specific cases, but in general combination of bad library typing and bad type checking tools leads to horrible user experience. So going forward my personal projects continue to be ducktyped, and if I care about types, I use…
Static typing makes Python tolerable.
Re: Ask HN: Which Python type checker should I use?
#48Pyright is the Microsoft provided lsp: does anyone else feel uneasy about using this? Especially given the EEE playbook "that we definitely won't do this time" - would love to have a discussion on this if someone could talk me into using it. I just use a combination of black, flake, and mypy. Apparently ruff is quite good as well. For lsp I use Jedi, which actually worked faster on my company's code base than pyright…
[1] https://github.com/microsoft/pyright/pull/7177#issuecomment-...
(In case you are wondering, I do not have the time to maintain an independent fork and I am not sure how Microsoft would react to one, now that I have heard Eric's concerns.)
Re: Ask HN: Which Python type checker should I use?
#49pyright is state of the art right now thanks to eric. If you use VSCode+Pylance you will feel right at home coming from Rust/TS. just be aware a lot of community packages aren't ready for typed python. if you stick to the good stuff like fastapi and pydantic, you will be fine.
Better than Pycharm?
But pycharm had a lot going on to make up for it.
Just as a reference I use pycharm mainly but before sending a PR I will rely on vscode to fix typing issues.
Just use what you likes best.
Re: Ask HN: Which Python type checker should I use?
#50Having the tool get started with Ronacher, of Flask fame, gives it some mindshare among those paying attention.
It would be better still if the PSF were endorsing, but that gets too political, I suppose.