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

When strict optional is disabled, anything can be falsey #6876

Merged
merged 2 commits into from May 22, 2019

Conversation

@JukkaL
Copy link
Collaborator

commented May 21, 2019

Previously some code was treated incorrectly as unreachable, since
some checks where treated as always true even though they could
be false given a None value.

Fixes #3601.

When strict optional is disabled, anything can be falsey
Previously some code was treated incorrectly as unreachable, since
some checks where treated as always true even though they could
be false given a None value.

Fixes #6827.

@JukkaL JukkaL requested a review from ilevkivskyi May 21, 2019

@ilevkivskyi
Copy link
Collaborator

left a comment

LGTM (modulo a possible typo in test).

Also are you sure you are mentioning the right issue in the PR description? The issue mentioned is already closed (as a duplicate).

if not a:
1() # E: "int" not callable
b = (1, 2)
if not a:

This comment has been minimized.

Copy link
@ilevkivskyi

ilevkivskyi May 21, 2019

Collaborator

Shouldn't this be b here?

This comment has been minimized.

Copy link
@JukkaL

JukkaL May 22, 2019

Author Collaborator

Yes!

@JukkaL

This comment has been minimized.

Copy link
Collaborator Author

commented May 22, 2019

Update the target issue; it was pointing to an obsolete duplicate.

@JukkaL JukkaL merged commit 14dc4b6 into master May 22, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@JelleZijlstra JelleZijlstra deleted the tuple-false-negative branch May 22, 2019

PattenR added a commit to PattenR/mypy that referenced this pull request Jun 23, 2019

When strict optional is disabled, anything can be falsey (python#6876)
Previously some code was treated incorrectly as unreachable, since
some checks where treated as always true even though they could
be false given a None value.

Fixes python#3601.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.