KEMBAR78
stubgen: Do not consider nested generators for return type by shoracek · Pull Request #12463 · python/mypy · GitHub
Skip to content

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