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

disable unreachable warnings in boolean ops on TypeVars with value restriction #9572

Merged
merged 1 commit into from Oct 18, 2020

Conversation

vbarbaresi
Copy link
Contributor

Description

This paragraph explains the limitation with TypeVars:
https://github.com/python/mypy/blob/eb50379defc13cea9a8cbbdc0254a578ef6c415e/mypy/checker.py#L967-#L974

We currently have no way of checking for all the type expansions,
and it's causing one part of the issue #9456

Using self.chk.should_report_unreachable_issues() honors the suppression of
the unreachable warning for TypeVar with value restrictions

Test Plan

I added a test statement that reproduces the unreachable false positive.
I added another test statement that is currently a false negative for the moment, because of the suppression for TypeVar type expansions.

…striction

This paragraph explains the limitation with TypeVars:
https://github.com/python/mypy/blob/eb50379defc13cea9a8cbbdc0254a578ef6c415e/mypy/checker.py#L967-#L974

We currently have no way of checking for all the type expansions,
and it's causing the issue python#9456

Using `self.chk.should_report_unreachable_issues()` honors the suppression of
the unreachable warning for TypeVar with value restrictions
@vbarbaresi vbarbaresi changed the title disable unreachable warnings in boolean ops on TypeVars with value restictioin disable unreachable warnings in boolean ops on TypeVars with value restiction Oct 10, 2020
@vbarbaresi vbarbaresi changed the title disable unreachable warnings in boolean ops on TypeVars with value restiction disable unreachable warnings in boolean ops on TypeVars with value restriction Oct 10, 2020
@msullivan msullivan merged commit e21214f into python:master Oct 18, 2020
@msullivan
Copy link
Collaborator

Thanks!

@vbarbaresi vbarbaresi deleted the fix_unreachable branch October 19, 2020 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants