My experience is pretty negative with all of them, I would be almost more tempted to ignore type checking in Python until it has drastically improved. In particular, if you're experienced with Typescript, you're probably going to be very disappointed when trying to do similar things in Python. The most recent one I've tried was Pyright. Pyright is faster than Mypy, and can also be configured to be quite strict, both…
Ask HN: Which Python type checker should I use?
21–30 of 83 posts
Re: Ask HN: Which Python type checker should I use?
#22just 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.
Re: Ask HN: Which Python type checker should I use?
#23My experience is pretty negative with all of them, I would be almost more tempted to ignore type checking in Python until it has drastically improved. In particular, if you're experienced with Typescript, you're probably going to be very disappointed when trying to do similar things in Python. The most recent one I've tried was Pyright. Pyright is faster than Mypy, and can also be configured to be quite strict, both…
Re: Ask HN: Which Python type checker should I use?
#24Re: Ask HN: Which Python type checker should I use?
#25Would 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?
#26Pyright 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…
Can the extension be used on VSCodium builds? If memory serves, C# tooling extensions are proprietary and are subject to unfortunate treatment when using open-source builds of VSCode.
Re: Ask HN: Which Python type checker should I use?
#27I enjoy typeguard for dynamic checking using the @typechecked decorator. I haven’t tried beartype, but I know lucidrains uses it.
Re: Ask HN: Which Python type checker should I use?
#28So going forward my personal projects continue to be ducktyped, and if I care about types, I use rust or go.
Re: Ask HN: Which Python type checker should I use?
#29Earlier quoted context omitted.
Can the extension be used on VSCodium builds? If memory serves, C# tooling extensions are proprietary and are subject to unfortunate treatment when using open-source builds of VSCode.
You are correct. It is not supported on vscodium.
Microsoft definitely seems to be pushing proprietary VSCode extensions where it's free to get users hooked on the product (and kill competitors) and then charge companies lots of money for the tools they got everyone hooked on because they appeared to be free.
Re: Ask HN: Which Python type checker should I use?
#30I 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…