]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386) (#130549)
authorHugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Mon, 17 Mar 2025 12:59:12 +0000 (14:59 +0200)
committerGitHub <noreply@github.com>
Mon, 17 Mar 2025 12:59:12 +0000 (14:59 +0200)
(cherry picked from commit 425587a110eb214a097c634d4b6d944ac478923e)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Doc/c-api/long.rst

index 972d69a519451186619298808e43452ce9ebeaf2..6e1cd1ece850e52dd9184c77dc9df2c4dc223494 100644 (file)
@@ -135,6 +135,16 @@ distinguished from a number.  Use :c:func:`PyErr_Occurred` to disambiguate.
    .. versionchanged:: 3.10
       This function will no longer use :meth:`~object.__int__`.
 
+   .. c:namespace:: NULL
+
+   .. c:function:: long PyLong_AS_LONG(PyObject *obj)
+
+      A :term:`soft deprecated` alias.
+      Exactly equivalent to the preferred ``PyLong_AsLong``. In particular,
+      it can fail with :exc:`OverflowError` or another exception.
+
+      .. deprecated:: 3.14
+         The function is soft deprecated.
 
 .. c:function:: long PyLong_AsLongAndOverflow(PyObject *obj, int *overflow)