Usage with Mypy #3623
Replies: 1 comment
-
Pyright and mypy are both Python type checkers. You can choose to use one, the other, or both. If you choose to use pyright, it will report its own type errors. If you want to use mypy, you will need to configure it appropriately for your editor. That's outside the scope of pyright though, so we won't be able to help you with that in this discussion forum. Mypy is designed for use as a command-line tool not as a language server. If you want to see mypy errors in your editor, you will need a language server. It's possible that someone has written a language server wrapper around mypy that is compatible with vim. You could also run mypy in a separate terminal window and configure it to run whenever it detects a source file change on disk, but it sounds like you want the issues to show up in your editor. You could switch your project to use pyright for type checking instead of mypy. They are largely compatible since they both follow PEP 484 and other typing standards. |
Beta Was this translation helpful? Give feedback.
-
Hi, sorry if this topic has already been discussed before, I couldn't find any results.
My project has been set up with Mypy, and I'd like to know about typing errors directly from vim instead of waiting for a commit hook to tell me about it.
My project's coc-settings file is:
If I set

"pyright.disableDiagnostics": true
, I cannot see any warnings in vim.If I set "pyright.disableDiagnostics": false`, I can only see pyright-related warnings.
I cannot see anything from Mypy. I'd like pyright to return only Mypy warnings in diagnostics.
When running mypy directly, it works fine:
Is there a working demo project with mypy-only linting I could reference to get my setup right ?
Beta Was this translation helpful? Give feedback.
All reactions