-
Notifications
You must be signed in to change notification settings - Fork 770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use pyright-specific comment for Quick Fix... > Add '# type: ignore' to suppress warning
#4494
Comments
You can tell pyright to ignore |
That's what I'm doing. And the reason I'd like Pylance to offer a different quick fix to suppress warning. |
in next pre-release, if the option |
@heejaechang, will you also include the specific diagnostic rule(s) for the line (e.g. |
okay |
This issue has been fixed in prerelease version 2023.10.41, which we've just released. You can find the changelog here: CHANGELOG.md |
@heejaechang I just tried it on the latest pre-release, and it works, but not all the time: |
It is not uncommon to run multiple type-checkers on the same code-base (ie mypy+pyright), especially in libraries and in typeshed.
To separate the different type errors, especially when the checkers disagree, it is possible to configure pyright to ignore
# type: ignore
comments.I think it would be more productive and better serve the users of pylance, if the "Quick fix" for suppression instead used
# pyright: ignore[reportedError]
, or at least offered it as an option.This:
Simply results in:
The text was updated successfully, but these errors were encountered: