diff options
author | Petr Viktorin <encukou@gmail.com> | 2024-09-27 23:40:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-27 23:40:50 (GMT) |
commit | 425587a110eb214a097c634d4b6d944ac478923e (patch) | |
tree | bb2f0b38d821450c94abf9721b57d65915e22160 /Doc | |
parent | 1ba35ea38562bfc0301bab4e098aa124e114b886 (diff) | |
download | cpython-425587a110eb214a097c634d4b6d944ac478923e.zip cpython-425587a110eb214a097c634d4b6d944ac478923e.tar.gz cpython-425587a110eb214a097c634d4b6d944ac478923e.tar.bz2 |
gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/long.rst | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst index 188eec4..e0ae0f7 100644 --- a/Doc/c-api/long.rst +++ b/Doc/c-api/long.rst @@ -159,7 +159,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:: @@ -181,6 +180,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) |