Skip to content
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

Please consider ignoring type ignore comments with special markers #12671

Closed
NeilGirdhar opened this issue Apr 25, 2022 · 3 comments
Closed

Please consider ignoring type ignore comments with special markers #12671

NeilGirdhar opened this issue Apr 25, 2022 · 3 comments
Labels
feature topic-type-ignore # type: ignore comments

Comments

@NeilGirdhar
Copy link
Contributor

I use both MyPy and Pyright on the same project. In some rare instances, Pyright has a false positive where MyPy does not. I mark these with # type: ignore[pyright].

The problem is that when I call MyPy with warn_unused_ignores = true, I get things like:

cmm/visualization/main_window.py:42: error: Unused "type: ignore" comment
                application.aboutToQuit.connect(self.plot_thread.terminate)  # type: ignore[pyright]

In my ideal world, Pyright would have its own error codes, and MyPy would know to ignore those when warning about unused errors. Perhaps, to start, MyPy could ignore # type: ignore[pyright].

@NeilGirdhar
Copy link
Contributor Author

Sorry for the noise, Pyright already has a mechanism for this. (See linked issue if interested.)

@erictraut
Copy link

@NeilGirdhar, you might also be interested in this feature request.

@NeilGirdhar
Copy link
Contributor Author

@erictraut Yes, I am. That looks like a good idea, which I would switch to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature topic-type-ignore # type: ignore comments
Projects
None yet
Development

No branches or pull requests

3 participants