Skip to content

Support inferring Unpack mixed with other items #12769

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 4 commits into from
Jun 10, 2022
Merged

Conversation

jhance
Copy link
Collaborator

@jhance jhance commented May 11, 2022

The main substance here modifies mypy/constraints.py to not assume that
template.items has length 1 in the case that there is an unpack. We
instead assume that that there is only a singular unpack, and do a
former pass to find what index it is in, and then resolve the unpack to
the corresponding subset of whatever tuple we are matching against.

@jhance jhance changed the title Support inferring Unpack mixed with other items. Support inferring Unpack mixed with other items May 11, 2022
@github-actions

This comment has been minimized.

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.

Looks good. Feel free to merge once the build is green.

jhance added 3 commits June 1, 2022 09:42
The main substance here modifies mypy/constraints.py to not assume that
template.items has length 1 in the case that there is an unpack. We
instead assume that that there is only a singular unpack, and do a
former pass to find what index it is in, and then resolve the unpack to
the corresponding subset of whatever tuple we are matching against.
@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2022

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@jhance jhance merged commit 9ccd081 into python:master Jun 10, 2022
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