Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Intern the names for all anonymous code objects. Patch by Zackery Spytz.
8 changes: 4 additions & 4 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -4145,7 +4145,7 @@ compiler_genexp(struct compiler *c, expr_ty e)
{
static identifier name;
if (!name) {
name = PyUnicode_FromString("<genexpr>");
name = PyUnicode_InternFromString("<genexpr>");
if (!name)
return 0;
}
Expand All @@ -4160,7 +4160,7 @@ compiler_listcomp(struct compiler *c, expr_ty e)
{
static identifier name;
if (!name) {
name = PyUnicode_FromString("<listcomp>");
name = PyUnicode_InternFromString("<listcomp>");
if (!name)
return 0;
}
Expand All @@ -4175,7 +4175,7 @@ compiler_setcomp(struct compiler *c, expr_ty e)
{
static identifier name;
if (!name) {
name = PyUnicode_FromString("<setcomp>");
name = PyUnicode_InternFromString("<setcomp>");
if (!name)
return 0;
}
Expand All @@ -4191,7 +4191,7 @@ compiler_dictcomp(struct compiler *c, expr_ty e)
{
static identifier name;
if (!name) {
name = PyUnicode_FromString("<dictcomp>");
name = PyUnicode_InternFromString("<dictcomp>");
if (!name)
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion Python/importlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ const unsigned char _Py_M__importlib[] = {
1,100,0,107,9,86,0,1,0,113,2,100,0,83,0,41,
1,78,114,10,0,0,0,41,2,90,2,46,48,90,3,97,
114,103,114,10,0,0,0,114,10,0,0,0,114,11,0,0,
0,250,9,60,103,101,110,101,120,112,114,62,65,1,0,0,
0,218,9,60,103,101,110,101,120,112,114,62,65,1,0,0,
115,2,0,0,0,4,0,122,45,95,105,110,115,116,97,108,
108,101,100,95,115,97,102,101,108,121,46,95,95,101,120,105,
116,95,95,46,60,108,111,99,97,108,115,62,46,60,103,101,
Expand Down
6 changes: 3 additions & 3 deletions Python/importlib_external.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const unsigned char _Py_M__importlib_external[] = {
116,114,105,112,218,15,112,97,116,104,95,115,101,112,97,114,
97,116,111,114,115,41,2,218,2,46,48,218,4,112,97,114,
116,114,2,0,0,0,114,2,0,0,0,114,4,0,0,0,
250,10,60,108,105,115,116,99,111,109,112,62,58,0,0,0,
218,10,60,108,105,115,116,99,111,109,112,62,58,0,0,0,
115,2,0,0,0,6,1,122,30,95,112,97,116,104,95,106,
111,105,110,46,60,108,111,99,97,108,115,62,46,60,108,105,
115,116,99,111,109,112,62,41,2,218,8,112,97,116,104,95,
Expand Down Expand Up @@ -1678,7 +1678,7 @@ const unsigned char _Py_M__importlib_external[] = {
2,86,0,1,0,113,2,100,1,83,0,41,2,114,186,0,
0,0,78,114,2,0,0,0,41,2,114,22,0,0,0,218,
6,115,117,102,102,105,120,41,1,218,9,102,105,108,101,95,
110,97,109,101,114,2,0,0,0,114,4,0,0,0,250,9,
110,97,109,101,114,2,0,0,0,114,4,0,0,0,218,9,
60,103,101,110,101,120,112,114,62,33,4,0,0,115,2,0,
0,0,4,1,122,49,69,120,116,101,110,115,105,111,110,70,
105,108,101,76,111,97,100,101,114,46,105,115,95,112,97,99,
Expand Down Expand Up @@ -2350,7 +2350,7 @@ const unsigned char _Py_M__importlib_external[] = {
0,104,0,124,0,93,12,125,1,124,1,160,0,161,0,146,
2,113,4,83,0,114,2,0,0,0,41,1,114,90,0,0,
0,41,2,114,22,0,0,0,90,2,102,110,114,2,0,0,
0,114,2,0,0,0,114,4,0,0,0,250,9,60,115,101,
0,114,2,0,0,0,114,4,0,0,0,218,9,60,115,101,
116,99,111,109,112,62,153,5,0,0,115,2,0,0,0,6,
0,122,41,70,105,108,101,70,105,110,100,101,114,46,95,102,
105,108,108,95,99,97,99,104,101,46,60,108,111,99,97,108,
Expand Down