8000 [3.13] gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-1243… · python/cpython@e8980b1 · GitHub
[go: up one dir, main page]

Skip to content

Commit e8980b1

Browse files
[3.13] gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386) (#124719)
gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386) (cherry picked from commit 425587a) Co-authored-by: Petr Viktorin <encukou@gmail.com>
1 parent f8e3de8 commit e8980b1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Doc/c-api/long.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
139139
.. versionadded:: 3.13
140140
141141
142-
.. XXX alias PyLong_AS_LONG (for now)
143142
.. c:function:: long PyLong_AsLong(PyObject *obj)
144143
145144
.. index::
@@ -161,6 +160,16 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
161160
.. versionchanged:: 3.10
162161
This function will no longer use :meth:`~object.__int__`.
163162
163+
.. c:namespace:: NULL
164+
165+
.. c:function:: long PyLong_AS_LONG(PyObject *obj)
166+
167+
A :term:`soft deprecated` alias.
168+
Exactly equivalent to the preferred ``PyLong_AsLong``. In particular,
169+
it can fail with :exc:`OverflowError` or another exception.
170+
171+
.. deprecated:: 3.14
172+
The function is soft deprecated.
164173
165174
.. c:function:: int PyLong_AsInt(PyObject *obj)
166175

0 commit comments

Comments
 (0)
0