Skip to content

stubgen: Do not consider nested generators for return type #12463

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 1 commit into from
Mar 27, 2022

Conversation

shoracek
Copy link
Contributor

@shoracek shoracek commented Mar 26, 2022

Description

Since yields in nested functions will not yield outside of the function being analyzed, they can be ignored.
I changed the parent of the class used to find the yields to one that does not search through nested functions.

Fixes #11893

Test Plan

I added code similar to the one from the issue's example to the unit tests.

Since yields in nested functions will not yield outside of the
considered function, they can be ignored.
@JelleZijlstra JelleZijlstra self-assigned this Mar 26, 2022
@github-actions
Copy link
Contributor

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

@JelleZijlstra JelleZijlstra merged commit 1480344 into python:master Mar 27, 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.

Stubgen applies Generator type to function with nested generator
2 participants