Skip to content

Commit

Permalink
Fix comprehensions comment to inlined by pep 709
Browse files Browse the repository at this point in the history
  • Loading branch information
rimi0108 committed Nov 2, 2024
1 parent 914356f commit 617c5d4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Python/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -4087,9 +4087,11 @@ codegen_call_helper(compiler *c, location loc,
return codegen_call_helper_impl(c, loc, n, args, NULL, keywords);
}

/* 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.
/* List and set comprehensions work by being inlined at the location where
they are defined. The isolation of iteration variables is provided by
pushing/popping clashing locals on the stack. 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
Expand Down

0 comments on commit 617c5d4

Please sign in to comment.