Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 15cc9a0

Browse files
committed
Removed unused var; added error check for ``lambda: x=1''.
1 parent fe4b6ee commit 15cc9a0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Python/compile.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,6 @@ com_factor(c, n)
10501050
struct compiling *c;
10511051
node *n;
10521052
{
1053-
int i;
10541053
REQ(n, factor);
10551054
if (TYPE(CHILD(n, 0)) == PLUS) {
10561055
com_factor(c, CHILD(n, 1));
@@ -1605,6 +1604,11 @@ com_assign(c, n, assigning)
16051604
return;
16061605
}
16071606
break;
1607+
1608+
case lambdef:
1609+
err_setstr(SyntaxError, "can't assign to lambda");
1610+
c->c_errors++;
1611+
return;
16081612

16091613
default:
16101614
fprintf(stderr, "node type %d\n", TYPE(n));

0 commit comments

Comments
 (0)