gh-121914: Change the names of the symbol tables for lambda and genexpr#135288
Merged
serhiy-storchaka merged 1 commit intopython:mainfrom Jul 13, 2025
Merged
Conversation
… genexpr Change the names of the symbol tables for lambda expressions and generator expressions to "<lambda>" and "<genexpr>" respectively to avoid conflicts with user-defined names.
picnixz
reviewed
Jun 9, 2025
Comment on lines
-258
to
-262
| # generators are of type TYPE_FUNCTION with a ".0" | ||
| # parameter as a first parameter (which makes them | ||
| # distinguishable from a function named 'genexpr') | ||
| if st.name == 'genexpr' and '.0' in st.varnames: | ||
| continue |
picnixz
approved these changes
Jun 9, 2025
| symtable_visit_listcomp(struct symtable *st, expr_ty e) | ||
| { | ||
| return symtable_handle_comprehension(st, e, &_Py_ID(listcomp), | ||
| return symtable_handle_comprehension(st, e, &_Py_STR(anon_listcomp), |
Member
There was a problem hiding this comment.
Should there be tests for this one too?
Member
Author
There was a problem hiding this comment.
I cannot write them.
|
taegyunkim
pushed a commit
to taegyunkim/cpython
that referenced
this pull request
Aug 4, 2025
… genexpr (pythonGH-135288) Change the names of the symbol tables for lambda expressions and generator expressions to "<lambda>" and "<genexpr>" respectively to avoid conflicts with user-defined names.
Agent-Hellboy
pushed a commit
to Agent-Hellboy/cpython
that referenced
this pull request
Aug 19, 2025
… genexpr (pythonGH-135288) Change the names of the symbol tables for lambda expressions and generator expressions to "<lambda>" and "<genexpr>" respectively to avoid conflicts with user-defined names.
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.
Change the names of the symbol tables for lambda expressions and generator expressions to "
<lambda>" and "<genexpr>" respectively to avoid conflicts with user-defined names.