KEMBAR78
Reset to previous statement when leaving `return` in semanal by sterliakov · Pull Request #19642 · python/mypy · GitHub
Skip to content

Conversation

sterliakov
Copy link
Collaborator

@sterliakov sterliakov commented Aug 11, 2025

Unlike other statements, return can be found in lambdas, and so is not immediately followed by another statement to check or EOF. We need to restore the previous value to continue checking it.

Fixes #19632

@github-actions
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@sterliakov sterliakov changed the title Reset to previous statement when leaving a return expr in semanal Reset to previous statement when leaving return in semanal Aug 12, 2025
@ilevkivskyi ilevkivskyi merged commit cb77a9b into python:master Aug 14, 2025
20 checks passed
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.

name-defined is whitespace-dependent

2 participants