Skip to content

Commit bbbe1fa

Browse files
authored
gh-106320: Remove private float C API functions (#108430)
106320: Remove private float C API functions Remove private C API functions: * _Py_parse_inf_or_nan() * _Py_string_to_number_with_underscores() Move these functions to the internal C API and no longer export them.
1 parent 773b803 commit bbbe1fa

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

Include/internal/pycore_floatobject.h

+7
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ extern int _PyFloat_FormatAdvancedWriter(
6767
Py_ssize_t start,
6868
Py_ssize_t end);
6969

70+
extern PyObject* _Py_string_to_number_with_underscores(
71+
const char *str, Py_ssize_t len, const char *what, PyObject *obj, void *arg,
72+
PyObject *(*innerfunc)(const char *, Py_ssize_t, void *));
73+
74+
extern double _Py_parse_inf_or_nan(const char *p, char **endptr);
75+
76+
7077
#ifdef __cplusplus
7178
}
7279
#endif

Include/pystrtod.h

-9
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,6 @@ PyAPI_FUNC(char *) PyOS_double_to_string(double val,
1818
int flags,
1919
int *type);
2020

21-
#ifndef Py_LIMITED_API
22-
PyAPI_FUNC(PyObject *) _Py_string_to_number_with_underscores(
23-
const char *str, Py_ssize_t len, const char *what, PyObject *obj, void *arg,
24-
PyObject *(*innerfunc)(const char *, Py_ssize_t, void *));
25-
26-
PyAPI_FUNC(double) _Py_parse_inf_or_nan(const char *p, char **endptr);
27-
#endif
28-
29-
3021
/* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */
3122
#define Py_DTSF_SIGN 0x01 /* always add the sign */
3223
#define Py_DTSF_ADD_DOT_0 0x02 /* if the result is an integer add ".0" */

0 commit comments

Comments
 (0)