Skip to content

Commit 425587a

Browse files
authored
gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386)
1 parent 1ba35ea commit 425587a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Doc/c-api/long.rst

+10-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
159159
.. versionadded:: 3.13
160160
161161
162-
.. XXX alias PyLong_AS_LONG (for now)
163162
.. c:function:: long PyLong_AsLong(PyObject *obj)
164163
165164
.. index::
@@ -181,6 +180,16 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
181180
.. versionchanged:: 3.10
182181
This function will no longer use :meth:`~object.__int__`.
183182
183+
.. c:namespace:: NULL
184+
185+
.. c:function:: long PyLong_AS_LONG(PyObject *obj)
186+
187+
A :term:`soft deprecated` alias.
188+
Exactly equivalent to the preferred ``PyLong_AsLong``. In particular,
189+
it can fail with :exc:`OverflowError` or another exception.
190+
191+
.. deprecated:: 3.14
192+
The function is soft deprecated.
184193
185194
.. c:function:: int PyLong_AsInt(PyObject *obj)
186195

0 commit comments

Comments
 (0)