Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0b94580

Browse files
committed
Add comments to the enum
1 parent fd4fe5c commit 0b94580

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

Include/internal/pycore_symtable.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@ extern "C" {
1010

1111
struct _mod; // Type defined in pycore_ast.h
1212

13-
typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock,
14-
AnnotationBlock, TypeVarBoundBlock, TypeAliasBlock,
15-
TypeParamBlock }
16-
_Py_block_ty;
13+
typedef enum _block_type {
14+
FunctionBlock, ClassBlock, ModuleBlock,
15+
// Used for annotations if 'from __future__ import annotations' is active.
16+
// Annotation blocks cannot bind names and are not evaluated.
17+
AnnotationBlock,
18+
// Used for generics and type aliases. These work mostly like functions
19+
// (see PEP 695 for details). The three different blocks function identically;
20+
// they are different enum entries only so that error messages can be more
21+
// precise.
22+
TypeVarBoundBlock, TypeAliasBlock, TypeParamBlock
23+
} _Py_block_ty;
1724

1825
typedef enum _comprehension_type {
1926
NoComprehension = 0,

0 commit comments

Comments
 (0)