summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorJelle Zijlstra <jelle.zijlstra@gmail.com>2024-04-22 19:50:26 (GMT)
committerGitHub <noreply@github.com>2024-04-22 19:50:26 (GMT)
commit85f727c5fb2afa60affa9ae3396ce4149cf5215d (patch)
treea0e58b94b0168299332053dca5a5100f4fc2b46d /Python
parent4c7bfdff90544deb5d2055fcbe4db4c2a231e95d (diff)
downloadcpython-85f727c5fb2afa60affa9ae3396ce4149cf5215d.zip
cpython-85f727c5fb2afa60affa9ae3396ce4149cf5215d.tar.gz
cpython-85f727c5fb2afa60affa9ae3396ce4149cf5215d.tar.bz2
gh-109118: Allow lambdas in annotation scopes in classes (#118019)
Diffstat (limited to 'Python')
-rw-r--r--Python/symtable.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 36ccc0e..483ef1c 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -2140,17 +2140,6 @@ symtable_visit_expr(struct symtable *st, expr_ty e)
VISIT(st, expr, e->v.UnaryOp.operand);
break;
case Lambda_kind: {
- if (st->st_cur->ste_can_see_class_scope) {
- // gh-109118
- PyErr_Format(PyExc_SyntaxError,
- "Cannot use lambda in annotation scope within class scope");
- PyErr_RangedSyntaxLocationObject(st->st_filename,
- e->lineno,
- e->col_offset + 1,
- e->end_lineno,
- e->end_col_offset + 1);
- VISIT_QUIT(st, 0);
- }
if (e->v.Lambda.args->defaults)
VISIT_SEQ(st, expr, e->v.Lambda.args->defaults);
if (e->v.Lambda.args->kw_defaults)