mirror of
https://github.com/python/cpython.git
synced 2025-11-20 02:50:14 +00:00
bpo-46541: Discover the global strings. (gh-31346)
Instead of manually enumerating the global strings in generate_global_objects.py, we extrapolate the list from usage of _Py_ID() and _Py_STR() in the source files. This is partly inspired by gh-31261. https://bugs.python.org/issue46541
This commit is contained in:
parent
278fdd3e3a
commit
12360aa159
9 changed files with 103 additions and 274 deletions
|
|
@ -644,12 +644,6 @@ extern "C" {
|
|||
\
|
||||
.strings = { \
|
||||
.literals = { \
|
||||
INIT_STR(empty, ""), \
|
||||
INIT_STR(dot, "."), \
|
||||
INIT_STR(comma_sep, ", "), \
|
||||
INIT_STR(percent, "%"), \
|
||||
INIT_STR(dbl_percent, "%%"), \
|
||||
\
|
||||
INIT_STR(anon_dictcomp, "<dictcomp>"), \
|
||||
INIT_STR(anon_genexpr, "<genexpr>"), \
|
||||
INIT_STR(anon_lambda, "<lambda>"), \
|
||||
|
|
@ -657,7 +651,12 @@ extern "C" {
|
|||
INIT_STR(anon_module, "<module>"), \
|
||||
INIT_STR(anon_setcomp, "<setcomp>"), \
|
||||
INIT_STR(anon_string, "<string>"), \
|
||||
INIT_STR(comma_sep, ", "), \
|
||||
INIT_STR(dbl_percent, "%%"), \
|
||||
INIT_STR(dot, "."), \
|
||||
INIT_STR(dot_locals, ".<locals>"), \
|
||||
INIT_STR(empty, ""), \
|
||||
INIT_STR(percent, "%"), \
|
||||
}, \
|
||||
.identifiers = { \
|
||||
INIT_ID(Py_Repr), \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue