mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
gh-132261: Store annotations at hidden internal keys in the class dict (#132345)
This commit is contained in:
parent
e5f68fd29b
commit
07b8d3117f
16 changed files with 100 additions and 52 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue