8000 Outdated post PEP-709 comment in `Python/codegen.c` · Issue #125832 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
8000
Outdated post PEP-709 comment in Python/codegen.c #125832
Closed
@Eclips4

Description

@Eclips4

Bug report

Bug description:

After the implementation of https://peps.python.org/pep-0709/, this comment looks wrong:

cpython/Python/codegen.c

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

Metadata

Metadata

Assignees

Labels

easyinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0