Skip to content

Try ignoring Anys in type object callables for purposes of overload ambiguity #10734

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 29, 2021

Conversation

msullivan
Copy link
Collaborator

I believe this should help with some issues that come up with #10694.

…mbiguity

I believe this should help with some issues that come up with #10694.
Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

This seems reasonable.

It would be good to have a test case -- or will the other PR cover this?

@msullivan msullivan merged commit 416f57b into master Jun 29, 2021
@msullivan msullivan deleted the ambiguity-no-obj-type branch June 29, 2021 19:36
pranavrajpal added a commit to pranavrajpal/mypy that referenced this pull request Jun 29, 2021
The first test makes sure the return type of the first register call
doesn't get turned to Any, which happens because mypy thinks there is
ambiguity around which overload variant of register to pick (ConstExpr
matches both Type[Any] and Callable[..., _T]). That should get fixed
by python#10734.

The second test makes sure we handle cases where we try to type check a
call before we've seen all the relevant registered implementations,
which didn't work when we were trying to find all registered
implementations and figure out which ones might get called.
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