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

Treat generators with await as async. #12925

Merged
merged 3 commits into from
Jun 2, 2022

Conversation

jhance
Copy link
Collaborator

@jhance jhance commented Jun 2, 2022

Fixes #12924 by using a traverser to find await expressions within a generator and then treat it as async if it is found.

A test is added. The test fails without this patch because the function has type Generator inferred, not AsyncGenerator.

@jhance jhance requested a review from JukkaL June 2, 2022 01:39
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

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 for the fix!

@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2022

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

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.

Mypy misunderstands poorly documented class of async generators
2 participants