New to Python but not new to type checking (Rust, Typescript). I don't know which type checker for Python I should invest in.
Ask HN: Which Python type checker should I use?
1–10 of 83 posts
Re: Ask HN: Which Python type checker should I use?
#2[dead]
Re: Ask HN: Which Python type checker should I use?
#3mypy is the most popular but if you want to use an extension then pyright from MS gave best experience for me.
Re: Ask HN: Which Python type checker should I use?
#4[deleted]
Re: Ask HN: Which Python type checker should I use?
#5I have been using pyright with lsp in emacs and can recommend.
Re: Ask HN: Which Python type checker should I use?
#6I've used mypy for a while, but I've wondered if it is worth switching to pyright, pyre, or pytype.
Re: Ask HN: Which Python type checker should I use?
#7Pyright by default because it's a LSP so I get to go definition, find references, etc... as well as the type checking in neovim. It's Pylance as part of the Python plugin in VS Code. Just make sure you go to the settings in Vs code and turn the type checking on to basic or strict. (It's off by default)
I tend to run mypy every now and then ad-hoc to check things and it sometimes finds things that need correcting but I wouldn't say it's as worth setting up as the former.
Re: Ask HN: Which Python type checker should I use?
#8Would also be interested in what is friendly with Django. Using VSCode + the Python extension, the default checker (Pylance?) just pukes on the ORM magic.
Re: Ask HN: Which Python type checker should I use?
#9Pyright is much faster than Mypy, we changed some times ago and went from something like 20 mins to less than 2.
Re: Ask HN: Which Python type checker should I use?
#10Pyright 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, a year or so ago.