Skip to content

Commit 4c1d529

Browse files
hugovkencukou
andauthored
[3.12] gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386) (#130549)
(cherry picked from commit 425587a) Co-authored-by: Petr Viktorin <[email protected]>
1 parent 3983fca commit 4c1d529

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Doc/c-api/long.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,16 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
135135
.. versionchanged:: 3.10
136136
This function will no longer use :meth:`~object.__int__`.
137137
138+
.. c:namespace:: NULL
139+
140+
.. c:function:: long PyLong_AS_LONG(PyObject *obj)
141+
142+
A :term:`soft deprecated` alias.
143+
Exactly equivalent to the preferred ``PyLong_AsLong``. In particular,
144+
it can fail with :exc:`OverflowError` or another exception.
145+
146+
.. deprecated:: 3.14
147+
The function is soft deprecated.
138148
139149
.. c:function:: long PyLong_AsLongAndOverflow(PyObject *obj, int *overflow)
140150

0 commit comments

Comments
 (0)