gh-132261: Store annotations at hidden internal keys in the class dict (#132345)

This commit is contained in:
Jelle Zijlstra 2025-04-10 21:13:26 -07:00 committed by GitHub
parent e5f68fd29b
commit 07b8d3117f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 100 additions and 52 deletions

View file

@ -815,7 +815,10 @@ codegen_process_deferred_annotations(compiler *c, location loc)
Py_DECREF(conditional_annotation_indices);
RETURN_IF_ERROR(codegen_leave_annotations_scope(c, loc));
RETURN_IF_ERROR(codegen_nameop(c, loc, &_Py_ID(__annotate__), Store));
RETURN_IF_ERROR(codegen_nameop(
c, loc,
ste->ste_type == ClassBlock ? &_Py_ID(__annotate_func__) : &_Py_ID(__annotate__),
Store));
return SUCCESS;
error: