Skip to content

Fix overload interaction with Any #5233

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
Jun 18, 2018
Merged

Conversation

ilevkivskyi
Copy link
Member

Fixes #5232

This also makes few minor amendments to pythoneval tests.

if all(is_subtype(ret_type, return_types[-1]) for ret_type in return_types[:-1]):
if all(is_subtype(ret_type, return_types[-1]) and
is_subtype(return_types[-1], ret_type)
for ret_type in return_types[:-1]):
# The last match is a supertype of all the previous ones, so it's safe
# to return that inferred type.
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should probably update this comment. Other then that, lgtm

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, will do.

@ilevkivskyi ilevkivskyi requested a review from Michael0x2a June 18, 2018 20:00
@ilevkivskyi
Copy link
Member Author

@JukkaL This reduces the number of errors in internal code bases, only five left in C (and all look like the same error). S however still has lots of errors because of typeshed.

@ilevkivskyi ilevkivskyi merged commit 8aebf0b into python:master Jun 18, 2018
@ilevkivskyi ilevkivskyi deleted the fix-overloads branch June 18, 2018 20:37
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