gh-130881: Handle conditionally defined annotations (#130935)

This commit is contained in:
Jelle Zijlstra 2025-03-25 20:48:19 -07:00 committed by GitHub
parent 7bb41aef4b
commit 898e6b395e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 506 additions and 74 deletions

View file

@ -124,6 +124,8 @@ typedef struct _symtable_entry {
enclosing class scope */
unsigned ste_has_docstring : 1; /* true if docstring present */
unsigned ste_method : 1; /* true if block is a function block defined in class scope */
unsigned ste_has_conditional_annotations : 1; /* true if block has conditionally executed annotations */
unsigned ste_in_conditional_block : 1; /* set while we are inside a conditionally executed block */
int ste_comp_iter_expr; /* non-zero if visiting a comprehension range expression */
_Py_SourceLocation ste_loc; /* source location of block */
struct _symtable_entry *ste_annotation_block; /* symbol table entry for this entry's annotations */