Skip to content
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

Fix unpack with overloaded __iter__ method #14817

Merged
merged 2 commits into from
Mar 2, 2023
Merged

Fix unpack with overloaded __iter__ method #14817

merged 2 commits into from
Mar 2, 2023

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Mar 2, 2023

The change is quite simple: instead of manually unpacking the return type of find_item, we use the regular machinery for it.

Note, that this PR does not include any metaclasses related work. We still have problems with them, but I will defer them to the next PR.

Closes #14811
CC @AlexWaygood

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

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

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.

Thanks for the fix! Looks good.

@JukkaL JukkaL merged commit bed49ab into master Mar 2, 2023
@JukkaL JukkaL deleted the issue-14811 branch March 2, 2023 12:23
@AlexWaygood
Copy link
Member

@sobolevn nice!

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.

Unpacking an iterable with an overloaded __iter__ method leads to variable silently being inferred as Any
3 participants