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

false positive: warn-unused-ignores checks in different python version blocks #10813

Closed
KotlinIsland opened this issue Jul 13, 2021 · 2 comments
Labels
bug mypy got something wrong

Comments

@KotlinIsland
Copy link
Contributor

This type ignore is valid, if python >= 3.9 the block isn't checked, but unused ignore is still checked and a false positive error is raised.

import sys

if sys.version_info < (3, 9):
    asdfgsdfgb()  # type: ignore

https://mypy-play.net/?mypy=latest&python=3.10&flags=warn-unused-ignores&gist=f40e0f6968779e61d62bec4a7b85b27c

@KotlinIsland KotlinIsland added the bug mypy got something wrong label Jul 13, 2021
@KotlinIsland
Copy link
Contributor Author

also:

import typing
if not typing.TYPE_CHECKING:
    asdfgsdfgb()  # type: ignore

@hauntsaninja
Copy link
Collaborator

Duplicate of #8823

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

2 participants