Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions Python/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -5412,23 +5412,6 @@ codegen_check_ann_expr(compiler *c, expr_ty e)
return SUCCESS;
}

static int
codegen_check_annotation(compiler *c, stmt_ty s)
{
/* Annotations of complex targets does not produce anything
under annotations future */
if (FUTURE_FEATURES(c) & CO_FUTURE_ANNOTATIONS) {
return SUCCESS;
}

/* Annotations are only evaluated in a module or class. */
if (SCOPE_TYPE(c) == COMPILE_SCOPE_MODULE ||
SCOPE_TYPE(c) == COMPILE_SCOPE_CLASS) {
return codegen_check_ann_expr(c, s->v.AnnAssign.annotation);
}
return SUCCESS;
}

static int
codegen_check_ann_subscr(compiler *c, expr_ty e)
{
Expand Down Expand Up @@ -5522,10 +5505,6 @@ codegen_annassign(compiler *c, stmt_ty s)
targ->kind);
return ERROR;
}
/* Annotation is evaluated last. */
if (future_annotations && !s->v.AnnAssign.simple && codegen_check_annotation(c, s) < 0) {
return ERROR;
}
return SUCCESS;
}

Expand Down
Loading