mirror of
https://github.com/python/cpython.git
synced 2025-09-15 13:16:12 +00:00
[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 425587a110
)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
parent
f8e3de8c7d
commit
e8980b17bb
1 changed files with 10 additions and 1 deletions
|
@ -139,7 +139,6 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
|
||||||
.. versionadded:: 3.13
|
.. versionadded:: 3.13
|
||||||
|
|
||||||
|
|
||||||
.. XXX alias PyLong_AS_LONG (for now)
|
|
||||||
.. c:function:: long PyLong_AsLong(PyObject *obj)
|
.. c:function:: long PyLong_AsLong(PyObject *obj)
|
||||||
|
|
||||||
.. index::
|
.. index::
|
||||||
|
@ -161,6 +160,16 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
|
||||||
.. versionchanged:: 3.10
|
.. versionchanged:: 3.10
|
||||||
This function will no longer use :meth:`~object.__int__`.
|
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)
|
.. c:function:: int PyLong_AsInt(PyObject *obj)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue