]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106320: Remove private float C API functions (#108430)
authorVictor Stinner <vstinner@python.org>
Thu, 24 Aug 2023 17:09:49 +0000 (19:09 +0200)
committerGitHub <noreply@github.com>
Thu, 24 Aug 2023 17:09:49 +0000 (19:09 +0200)
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.

Include/internal/pycore_floatobject.h
Include/pystrtod.h

index 6b9af03c25ec36e2719b4e85d74189382f2128e0..4e5474841bc25da8b78215093f04609157d80181 100644 (file)
@@ -67,6 +67,13 @@ extern int _PyFloat_FormatAdvancedWriter(
     Py_ssize_t start,
     Py_ssize_t end);
 
+extern PyObject* _Py_string_to_number_with_underscores(
+    const char *str, Py_ssize_t len, const char *what, PyObject *obj, void *arg,
+    PyObject *(*innerfunc)(const char *, Py_ssize_t, void *));
+
+extern double _Py_parse_inf_or_nan(const char *p, char **endptr);
+
+
 #ifdef __cplusplus
 }
 #endif
index fa056d17b6395fc3d7cdb435ea4c44d089432b99..e83d245eb623afabe3a5843e18bc0f6e2e5ba1b1 100644 (file)
@@ -18,15 +18,6 @@ PyAPI_FUNC(char *) PyOS_double_to_string(double val,
                                          int flags,
                                          int *type);
 
-#ifndef Py_LIMITED_API
-PyAPI_FUNC(PyObject *) _Py_string_to_number_with_underscores(
-    const char *str, Py_ssize_t len, const char *what, PyObject *obj, void *arg,
-    PyObject *(*innerfunc)(const char *, Py_ssize_t, void *));
-
-PyAPI_FUNC(double) _Py_parse_inf_or_nan(const char *p, char **endptr);
-#endif
-
-
 /* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */
 #define Py_DTSF_SIGN      0x01 /* always add the sign */
 #define Py_DTSF_ADD_DOT_0 0x02 /* if the result is an integer add ".0" */