Skip to content

Use information from find_isinstance_check typing boolean operators #1828

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 1 commit into from
Jul 8, 2016

Conversation

ddfisher
Copy link
Collaborator

@ddfisher ddfisher commented Jul 8, 2016

Fixes #1817, fixes #1733.

This is a simpler/less special-cased version of #1818. We already have conditional type map information about the operands, so we can use that instead of special casing Optional.

Steals the tests from #1818 and adds one for None and "foo" (which we know to always be None).

@gvanrossum gvanrossum merged commit 4c11bb3 into master Jul 8, 2016
@gvanrossum gvanrossum deleted the optional-x-or-x-alternate branch July 8, 2016 00:33
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.

Improve type inference for "Optional[T] or T" expression Type inference of or and Optional[x]
2 participants