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
gh-NNNN: Remove Python/dtoa.c and its init/fini plumbing
Python/dtoa.c (the 2800-line David Gay dtoa + _Py_dg_strtod) is now
completely unreachable — format_float_short and _PyOS_ascii_strtod went
through _Py_fmt_dtoa and _Py_wuffs_strtod in the previous two commits.
Delete the file and strip the plumbing it had acquired across the rest
of the tree:
* Include/internal/pycore_dtoa.h: drop the _Py_dg_* declarations,
_PyDtoa_Init/Fini, and _dtoa_state_INIT. Header now only declares
_Py_fmt_dtoa / _Py_fmt_dtoa_free / _Py_wuffs_strtod.
* Include/internal/pycore_interp_structs.h: remove `struct Bigint`,
`struct _dtoa_state`, and the `dtoa` field on `PyInterpreterState`.
Saves ~2.3 KB of static state per interpreter.
* Include/internal/pycore_runtime_init.h: drop the `.dtoa = ...`
line and the now-unused pycore_dtoa.h include.
* Python/pystate.c / Python/pylifecycle.c: drop the dtoa-state fix-up
in per-interpreter init and the _PyDtoa_Init / _PyDtoa_Fini calls.
* Makefile.pre.in: drop Python/dtoa.o from LIBRARY_OBJS and the
dedicated -fno-strict-aliasing rule that existed to work around a
clang 4 miscompile of dtoa's ratio() (bpo-30104).
* PCbuild/pythoncore.vcxproj{,.filters}: drop the ClCompile entry for
Python/dtoa.c on Windows.
Full float-formatting + strtod + C-API regression passes (1,501 tests
across test_float, test_strtod, test_format, test_capi).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments