Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
msullivan merged 1 commit into
python:masterfrom
vbarbaresi:fix_unreachable
Oct 18, 2020
Merged

disable unreachable warnings in boolean ops on TypeVars with value restriction#9572
msullivan merged 1 commit into
python:masterfrom
vbarbaresi:fix_unreachable

Conversation

@vbarbaresi

Copy link
Copy Markdown
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
Copy Markdown
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.

2 participants