mirror of https://github.com/python/cpython.git
gh-106320: Remove private _PyLong_New() function (#108604)
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.
This commit is contained in:
parent
21a7420190
commit
921eb8ebf6
|
@ -89,14 +89,6 @@ struct _longobject {
|
||||||
_PyLongValue long_value;
|
_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
|
/* Inline some internals for speed. These should be in pycore_long.h
|
||||||
* if user code didn't need them inlined. */
|
* if user code didn't need them inlined. */
|
||||||
|
|
|
@ -47,6 +47,17 @@ extern "C" {
|
||||||
# error "_PY_LONG_DEFAULT_MAX_STR_DIGITS smaller than threshold."
|
# error "_PY_LONG_DEFAULT_MAX_STR_DIGITS smaller than threshold."
|
||||||
#endif
|
#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 */
|
/* runtime lifecycle */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue