You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The binary files produced by compiling python twice are different #93317
hi, man, i find a problem, that the binary files produced by compiling python twice are different. I was confused for a long time. The different pyc files are the following.
i find different places are DA and FA with Beyond Compare.
configparser.cpython-39.pyc
argparse.cpython-39.pyc
then, i see this is string instern after i study the source code of cpython, These strings are ”{“ ”{{“ ”}“ ”}“
staticintmaybe_init_static_strings(void)
{
if (!_str_open_br&&
!(_str_open_br=PyUnicode_InternFromString("{"))) {
return-1;
}
if (!_str_dbl_open_br&&
!(_str_dbl_open_br=PyUnicode_InternFromString("{{"))) {
return-1;
}
if (!_str_close_br&&
!(_str_close_br=PyUnicode_InternFromString("}"))) {
return-1;
}
if (!_str_dbl_close_br&&
!(_str_dbl_close_br=PyUnicode_InternFromString("}}"))) {
return-1;
}
if (!_str_inf&&
!(_str_inf=PyUnicode_FromString("inf"))) {
return-1;
}
if (!_str_replace_inf&&
!(_str_replace_inf=PyUnicode_FromFormat("1e%d", 1+DBL_MAX_10_EXP))) {
return-1;
}
return0;
}
python >3.8 compile with multithreading, so there may be different by compiling python twice. and if i add code here, it is OK! This is just my temporary plan, but i don't think this is a good idea, and i hope you could fix it
Activity
JelleZijlstra commentedon May 28, 2022
#73894 is the general issue about this.
ericvsmith commentedon May 28, 2022
Closing on favor of #73894.