Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix type of conditional statement to Union and not Join. (#3487) #5041

Merged
merged 2 commits into from
May 14, 2018
Merged

Fix type of conditional statement to Union and not Join. (#3487) #5041

merged 2 commits into from
May 14, 2018

Conversation

MentalMegalodon
Copy link
Contributor

No description provided.

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

Thanks! Look good, I have just one small comment.

@@ -385,7 +385,7 @@ def lookup_field(name, obj):
attr = None

[case testTernaryWithNone]
reveal_type(None if bool() else 0) # E: Revealed type is 'Union[builtins.int, builtins.None]'
reveal_type(None if bool() else 0) # E: Revealed type is 'Union[builtins.None, builtins.int]'
Copy link
Member

Choose a reason for hiding this comment

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

Could you please add few dedicated tests? (Probably not in this test but in check-unions)

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@msullivan msullivan merged commit 532f3fb into python:master May 14, 2018
JukkaL added a commit that referenced this pull request May 22, 2018
Use a join for type of a conditional expression unless the type context
is a union type.

A recent change (#5041) modified the type to always use a union, but this
caused many problems in internal Dropbox repos that we aren't ready to
fix yet.
msullivan pushed a commit that referenced this pull request May 24, 2018
Use a join for type of a conditional expression unless the type context
is a union type.

A recent change (#5041) modified the type to always use a union, but this
caused many problems in internal Dropbox repos that we aren't ready to
fix yet.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants