Skip to content

Commit 98242b4

Browse files
committed
gh-127937: deprecate _PyLong_FromDigits() function
1 parent 2de048c commit 98242b4

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Doc/deprecations/c-api-pending-removal-in-future.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ although there is currently no date scheduled for their removal.
3535
* :c:member:`!PyBytesObject.ob_shash` member:
3636
call :c:func:`PyObject_Hash` instead.
3737
* :c:member:`!PyDictObject.ma_version_tag` member.
38+
* :c:func::c:func:`!_PyLong_FromDigits`
39+
Use instead :c:struct:`PyLongWriter` API.
3840
* Thread Local Storage (TLS) API:
3941

4042
* :c:func:`PyThread_create_key`:

Include/cpython/longintrepr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ PyAPI_FUNC(PyLongObject*) _PyLong_New(Py_ssize_t);
105105
// Return a copy of src.
106106
PyAPI_FUNC(PyObject*) _PyLong_Copy(PyLongObject *src);
107107

108-
PyAPI_FUNC(PyLongObject*) _PyLong_FromDigits(
108+
Py_DEPRECATED(3.14) PyAPI_FUNC(PyLongObject*) _PyLong_FromDigits(
109109
int negative,
110110
Py_ssize_t digit_count,
111111
digit *digits);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Deprecate the :c:func:`!_PyLong_FromDigits`, use instead
2+
:c:struct:`PyLongWriter` API. Patch by Sergey B Kirpichev.

0 commit comments

Comments
 (0)