Skip to content

Add narrowing Union w/ bool Literal via identity check #8821

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

Merged
merged 3 commits into from
May 19, 2020
Merged

Add narrowing Union w/ bool Literal via identity check #8821

merged 3 commits into from
May 19, 2020

Conversation

sbdchd
Copy link
Contributor

@sbdchd sbdchd commented May 14, 2020

Allows for narrowing Union[str, Literal[False]] via is not False.

related: #8368

fixes: #8810

Allows for narrowing `Union[str, Literal[False]]` via `is not False`.

related: #8368

fixes: #8810
@sbdchd sbdchd changed the title Add narrowing Union with boolean Literal with identity check Add narrowing Union w/ bool Literal via identity check May 14, 2020
Copy link
Collaborator

@msullivan msullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Thanks!

@msullivan msullivan merged commit 65e3a89 into python:master May 19, 2020
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.

Narrow Union[str, Literal[False]] via is
2 participants