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

Skip to content

Commit 32d3e05

Browse files
picnixzcarljmJelleZijlstra
authored
gh-120029: remove unused macros in symtable.c (#120222)
Co-authored-by: Carl Meyer <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
1 parent e16aed6 commit 32d3e05

File tree

3 files changed

+0
-6
lines changed

3 files changed

+0
-6
lines changed

Include/internal/pycore_symtable.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ extern PyObject* _Py_Mangle(PyObject *p, PyObject *name);
143143
#define DEF_PARAM (2<<1) /* formal parameter */
144144
#define DEF_NONLOCAL (2<<2) /* nonlocal stmt */
145145
#define USE (2<<3) /* name is used */
146-
#define DEF_FREE (2<<4) /* name used but not defined in nested block */
147146
#define DEF_FREE_CLASS (2<<5) /* free variable from class's method */
148147
#define DEF_IMPORT (2<<6) /* assignment occurred via import */
149148
#define DEF_ANNOT (2<<7) /* this name is annotated */
@@ -166,9 +165,6 @@ extern PyObject* _Py_Mangle(PyObject *p, PyObject *name);
166165
#define FREE 4
167166
#define CELL 5
168167

169-
#define GENERATOR 1
170-
#define GENERATOR_EXPRESSION 2
171-
172168
// Used by symtablemodule.c
173169
extern struct symtable* _Py_SymtableStringObjectFlags(
174170
const char *str,

Modules/symtablemodule.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ symtable_init_constants(PyObject *m)
7676
if (PyModule_AddIntMacro(m, DEF_LOCAL) < 0) return -1;
7777
if (PyModule_AddIntMacro(m, DEF_PARAM) < 0) return -1;
7878
if (PyModule_AddIntMacro(m, DEF_TYPE_PARAM) < 0) return -1;
79-
if (PyModule_AddIntMacro(m, DEF_FREE) < 0) return -1;
8079
if (PyModule_AddIntMacro(m, DEF_FREE_CLASS) < 0) return -1;
8180
if (PyModule_AddIntMacro(m, DEF_IMPORT) < 0) return -1;
8281
if (PyModule_AddIntMacro(m, DEF_BOUND) < 0) return -1;

Python/symtable.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ static void _dump_symtable(PySTEntryObject* ste, PyObject* prefix)
327327
if (flags & DEF_PARAM) printf(" DEF_PARAM");
328328
if (flags & DEF_NONLOCAL) printf(" DEF_NONLOCAL");
329329
if (flags & USE) printf(" USE");
330-
if (flags & DEF_FREE) printf(" DEF_FREE");
331330
if (flags & DEF_FREE_CLASS) printf(" DEF_FREE_CLASS");
332331
if (flags & DEF_IMPORT) printf(" DEF_IMPORT");
333332
if (flags & DEF_ANNOT) printf(" DEF_ANNOT");

0 commit comments

Comments
 (0)