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

Environment markers for type: ignore comments #12946

Closed
tsibley opened this issue Jun 6, 2022 · 3 comments
Closed

Environment markers for type: ignore comments #12946

tsibley opened this issue Jun 6, 2022 · 3 comments
Labels
feature topic-type-ignore # type: ignore comments

Comments

@tsibley
Copy link

tsibley commented Jun 6, 2022

Feature

Extend # type: ignore[code] comments to allow further tagging/scoping/targeting them to a particular type checker (e.g. mypy vs. pyright). Perhaps something like:

# type: ignore[attr-defined]; type_checker=mypy

aping the PEP 508 environment marker syntax, but any syntax would be ok.

This will require co-operation with the rest of the type checking tools, but I'm hoping mypy can lead here.

Pitch

I use both mypy and pyright to check types as their checks don't completely overlap and so using both catches a bit more than just using one. When an ignore is necessary for one but not the other, I'd like to be able to more selectively ignore just for that type checker so that the other continues to check the line.

@tsibley tsibley added the feature label Jun 6, 2022
@AlexWaygood AlexWaygood added the topic-type-ignore # type: ignore comments label Jun 6, 2022
@AlexWaygood
Copy link
Member

Duplicate of #12358.

Specifically, see #12358 (comment)

@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Jun 6, 2022
@tsibley
Copy link
Author

tsibley commented Jun 6, 2022

@AlexWaygood Ah, thank you! I'd missed that issue when I searched before filing this one and hadn't noticed the tag I could have used to help find it.

@AlexWaygood
Copy link
Member

@tsibley no worries! There are a lot of mypy issues to wade through :)

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

2 participants