10000 undo some unnecessary changes · python/cpython@e36c5f5 · GitHub
[go: up one dir, main page]

Skip to content

Commit e36c5f5

Browse files
committed
undo some unnecessary changes
1 parent dba4293 commit e36c5f5

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed

Include/internal/pycore_symtable.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extern "C" {
1010

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

13-
typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock, AnnotationBlock, TypeParamBlock }
13+
typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock, AnnotationBlock }
1414
_Py_block_ty;
1515

1616
typedef enum _comprehension_type {
@@ -49,11 +49,6 @@ typedef struct _symtable_entry {
4949
PyObject *ste_varnames; /* list of function parameters */
5050
PyObject *ste_children; /* list of child blocks */
51 8000 51
PyObject *ste_directives;/* locations of global and nonlocal statements */
52-
int ste_active_typeparam_scope; /* 0 if no active typeparam scope */
53-
int ste_num_typeparam_scopes; /* number of typeparam scopes encountered */
54-
PyObject *ste_typeparam_map; /* map of typeparam names to mangled names,
55-
only exists while we're in ste_active_typeparam_scope */
56-
PyObject *ste_parent_typeparam_map; /* same, but represents typeparams present in parents */
5752
_Py_block_ty ste_type; /* module, class, function or annotation */
5853
int ste_nested; /* true if block is nested */
5954
unsigned ste_free : 1; /* true if block has free variables */
@@ -109,7 +104,6 @@ extern PyObject* _Py_Mangle(PyObject *p, PyObject *name);
109104
#define DEF_IMPORT 2<<6 /* assignment occurred via import */
110105
#define DEF_ANNOT 2<<7 /* this name is annotated */
111106
#define DEF_COMP_ITER 2<<8 /* this name is a comprehension iteration variable */
112-
#define DEF_TYPE_PARAM 2<<9 /* this name is a type parameter */
113107

114108
#define DEF_BOUND (DEF_LOCAL | DEF_PARAM | DEF_IMPORT)
115109

Python/compile.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ enum {
196196
COMPILER_SCOPE_ASYNC_FUNCTION,
197197
COMPILER_SCOPE_LAMBDA,
198198
COMPILER_SCOPE_COMPREHENSION,
199-
COMPILER_SCOPE_TYPE_PARAMS,
200199
};
201200

202201
typedef struct {
@@ -1274,7 +1273,6 @@ compiler_enter_scope(struct compiler *c, identifier name,
12741273
compiler_unit_free(u);
12751274
return ERROR;
12761275
}
1277-
u->u_ste->ste_num_typeparam_scopes = 0;
12781276
u->u_name = Py_NewRef(name);
12791277
u->u_varnames = list2dict(u->u_ste->ste_varnames);
12801278
u->u_cellvars = dictbytype(u->u_ste->ste_symbols, CELL, 0, 0);

Python/symtable.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,9 +635,6 @@ update_symbols(PyObject *symbols, PyObject *scopes,
635635
long scope, flags;
636636
assert(PyLong_Check(v));
637637
flags = PyLong_AS_LONG(v);
638-
if (flags & DEF_TYPE_PARAM) {
639-
continue;
640-
}
641638
v_scope = PyDict_GetItemWithError(scopes, name);
642639
assert(v_scope && PyLong_Check(v_scope));
643640
scope = PyLong_AS_LONG(v_scope);

0 commit comments

Comments
 (0)
0