Repository navigation
Closed
Labels
easyinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
After the implementation of https://peps.python.org/pep-0709/, this comment looks wrong:
Lines 4079 to 4090 in 57e3c59
| /* List and set comprehensions and generator expressions work by creating a | |
| nested function to perform the actual iteration. This means that the | |
| iteration variables don't leak into the current scope. | |
| The defined function is called immediately following its definition, with the | |
| result of that call being the result of the expression. | |
| The LC/SC version returns the populated container, while the GE version is | |
| flagged in symtable.c as a generator, so it returns the generator object | |
| when the function is called. | |
| Possible cleanups: | |
| - iterate over the generator sequence instead of using recursion | |
| */ |
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-125832: Clarify comment for inlined comprehensions as per PEP-709 #126322
- [3.13] gh-125832: Clarify comment for inlined comprehensions as per PEP-709 (gh-126322) #126344
- [3.12] gh-125832: Clarify comment for inlined comprehensions as per P… #126345
- gh-125832: Reformat comments for inlined comprehensions #126346
Reacted by Mikhail Efimov
Metadata
Metadata
Assignees
Labels
easyinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
picnixz commentedon Oct 22, 2024
Haven't checked in the code yet but generator expressions do not seem to be concerned by the inlining:
rimi0108 commentedon Nov 2, 2024
I will take a look :)
corona10 commentedon Nov 2, 2024
@willingc
@rimi0108 is going to take a look at this issue during the KR sprint too :)
[-]Outdated comment in `Python/codegen.c`[/-][+]Outdated post PEP-709 comment in `Python/codegen.c`[/+]gh-125832: Clarify comment for inlined comprehensions as per PEP-709 (#…
corona10 commentedon Nov 3, 2024
Thanks for the contribution! @rimi0108
corona10 commentedon Nov 3, 2024
We need to handle backport patch as well.
pythongh-125832: Clarify comment for inlined comprehensions as per PE…
[3.12] pythongh-125832: Clarify comment for inlined comprehensions as…
pythongh-125832: Reformat comments for inlined comprehensions
[3.12] gh-125832: Clarify comment for inlined comprehensions as per P… (
[3.13] gh-125832: Clarify comment for inlined comprehensions as per P…
gh-125832: Reformat comments for inlined comprehensions (gh-126346)
pythongh-125832: Clarify comment for inlined comprehensions as per PE…
pythongh-125832: Reformat comments for inlined comprehensions (python…
pythongh-125832: Clarify comment for inlined comprehensions as per PE…
pythongh-125832: Reformat comments for inlined comprehensions (python…