Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am opening this PR to keep an inner query-result guard inside its enclosing
elsewhen both share a merge target. The code below currently moves the guard outside theelse, whererowcan be unassigned:The affected region currently becomes:
On the active branch, the moved guard reads
rowbefore it has been assigned.An inner guard can share the enclosing else's merge target. The block-closing rule currently closes that else before parsing the guard, moving it to the surrounding scope. The fix preserves the else when its start is immediately preceded by an unconditional then-arm jump that proves its finite end.
Variations include synchronous fetches, an attribute source, literal/call/subscript value expressions, subsequent work in the else, and an independent guard outside it. A guard that is actually outside the else keeps that placement. The additional boundary proof applies to the existing Python 3.11+ path.