We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ade7460 commit 13724e5Copy full SHA for 13724e5
1 file changed
Python/ast.c
@@ -2120,6 +2120,10 @@ ast_for_expr_stmt(struct compiling *c, const node *n)
2120
for (i = 0; i < NCH(n) - 2; i += 2) {
2121
expr_ty e;
2122
node *ch = CHILD(n, i);
2123
+ if (TYPE(ch) == yield_expr) {
2124
+ ast_error(ch, "assignment to yield expression not possible");
2125
+ return NULL;
2126
+ }
2127
e = ast_for_testlist(c, ch);
2128
2129
/* set context to assign */
0 commit comments