]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106320: Remove private _PyLong_New() function (#108604)
authorVictor Stinner <vstinner@python.org>
Tue, 29 Aug 2023 02:59:49 +0000 (04:59 +0200)
committerGitHub <noreply@github.com>
Tue, 29 Aug 2023 02:59:49 +0000 (04:59 +0200)
Move the following private API to the internal C API (pycore_long.h):

* _PyLong_Copy()
* _PyLong_FromDigits()
* _PyLong_New()

No longer export most of these functions.

Include/cpython/longintrepr.h
Include/internal/pycore_long.h

index 692c69ba76db2ffd25fa9f3aa2090b4fa255444e..fb82f83dc50e427183b2032f352ecd2d694e4e65 100644 (file)
@@ -89,14 +89,6 @@ struct _longobject {
     _PyLongValue long_value;
 };
 
-PyAPI_FUNC(PyLongObject *) _PyLong_New(Py_ssize_t);
-
-/* Return a copy of src. */
-PyAPI_FUNC(PyObject *) _PyLong_Copy(PyLongObject *src);
-
-PyAPI_FUNC(PyLongObject *)
-_PyLong_FromDigits(int negative, Py_ssize_t digit_count, digit *digits);
-
 
 /* Inline some internals for speed. These should be in pycore_long.h
  * if user code didn't need them inlined. */
index c9d82711862895f2f5165890dea431e3ec806a9f..c411ac654387c3d5ad6e82d465a83ec179be5ad7 100644 (file)
@@ -47,6 +47,17 @@ extern "C" {
 # error "_PY_LONG_DEFAULT_MAX_STR_DIGITS smaller than threshold."
 #endif
 
+extern PyLongObject* _PyLong_New(Py_ssize_t);
+
+// Return a copy of src.
+extern PyObject* _PyLong_Copy(PyLongObject *src);
+
+// Export for '_decimal' shared extension
+PyAPI_FUNC(PyLongObject*) _PyLong_FromDigits(
+    int negative,
+    Py_ssize_t digit_count,
+    digit *digits);
+
 
 /* runtime lifecycle */