-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
mypy --warn-unused-ignores doesn't work #6307
Comments
And I just double checked: If I create a file def foo() -> None: ... # type: ignore and run |
And another data point: When I run |
Happens to me too.
|
Same for me, on Windows. |
You'll want to comment out https://github.com/python/mypy/blob/50db29a527595822fe6f76053a6a54f5c301649a/mypy/errors.py#L465 Okay, intersecting 3.6 and 3.10 I get:
From a skim, I think something or the other would complain if you removed them, but please feel free to try, |
We figured out the reason for mypy's behavior, so this can be closed. |
@JelleZijlstra Could you provide a little more detail? Are we using mypy incorrectly? Or is this a bug in mypy that may be fixed in a future release? Is there another issue or PR that might provide more detail? |
mypy has specific logic that suppresses this error in typeshed. |
mypy intentionally doesn't respect Enabling |
I'm unsure about the reason, but when I locally run
mypy --warn-unused-ignores stdlib/builtins.pyi
(or any other file instdlib
orstubs
) where I have manually added an unnecessary# type: ignore
, I get no warnings. mypy is current in my venv (0.910) and I deleted.mypy_cache
to make sure. The same happened when I ran./tests/mypy_test.py --warn-unused-ignores
, which is how I noticed.Does anyone else have this problem?
The text was updated successfully, but these errors were encountered: