From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 30 Sep 2024 00:59:54 +0000 (+0200) Subject: [3.13] gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386) (#124719) X-Git-Tag: v3.13.0rc3~40 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e8980b17bb72508c7cbf8c364be647eef9b512bf;p=thirdparty%2FPython%2Fcpython.git [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 425587a110eb214a097c634d4b6d944ac478923e) Co-authored-by: Petr Viktorin --- diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst index 6de165d0b26d..c9e277680aba 100644 --- a/Doc/c-api/long.rst +++ b/Doc/c-api/long.rst @@ -139,7 +139,6 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate. .. versionadded:: 3.13 -.. XXX alias PyLong_AS_LONG (for now) .. c:function:: long PyLong_AsLong(PyObject *obj) .. index:: @@ -161,6 +160,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:: int PyLong_AsInt(PyObject *obj)