The Wayback Machine - https://web.archive.org/web/20251126115545/https://github.com/python/cpython/pull/118526
Skip to content

Conversation

@carljm
Copy link
Member

@carljm carljm commented May 2, 2024 •

The handling of a name with one scope outside the comprehension and another inside it was missing the case where a name is implicit-global inside the comprehension, but becomes a local outside the comprehension due to another inlined comprehension in the same scope which binds the name. Cover this case as well.

@carljm carljm added the needs backport to 3.12 only security fixes label May 2, 2024
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I have several questions :)

@carljm
Copy link
Member Author

carljm commented May 3, 2024

Thanks for the reviews! I've addressed all comments, enabling auto-merge.

@carljm carljm enabled auto-merge (squash) May 3, 2024 13:43
@carljm carljm merged commit c8deb1e into python:main May 3, 2024
@miss-islington-app
Copy link

Thanks @carljm for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 3, 2024
…and global in the other (pythonGH-118526)

(cherry picked from commit c8deb1e)

Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
@bedevere-app
Copy link

bedevere-app bot commented May 3, 2024

GH-118548 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label May 3, 2024
carljm added a commit that referenced this pull request May 3, 2024
… and global in the other (GH-118526) (#118548)

gh-118513: Fix sibling comprehensions with a name bound in one and global in the other (GH-118526)
(cherry picked from commit c8deb1e)

Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
…and global in the other (python#118526)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants