diff options
author | Yuki Kobayashi <drsuaimqjgar@gmail.com> | 2024-12-16 13:56:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-16 13:56:04 (GMT) |
commit | 52d552cda7614c7aa9f08b680089c630587e747f (patch) | |
tree | c788b39f4139b76458b1a7382462eac2a6b704c2 | |
parent | 0d8e7106c260e96c4604f501165bd106bff51f6b (diff) | |
download | cpython-52d552cda7614c7aa9f08b680089c630587e747f.zip cpython-52d552cda7614c7aa9f08b680089c630587e747f.tar.gz cpython-52d552cda7614c7aa9f08b680089c630587e747f.tar.bz2 |
gh-127896: Add missing documentation of `PySequence_In` (GH-127979)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
-rw-r--r-- | Doc/c-api/sequence.rst | 9 | ||||
-rw-r--r-- | Doc/whatsnew/3.14.rst | 4 | ||||
-rw-r--r-- | Misc/NEWS.d/next/C_API/2024-12-16-07-12-15.gh-issue-127896.HmI9pk.rst | 2 |
3 files changed, 15 insertions, 0 deletions
diff --git a/Doc/c-api/sequence.rst b/Doc/c-api/sequence.rst index ce28839..df5bf6b 100644 --- a/Doc/c-api/sequence.rst +++ b/Doc/c-api/sequence.rst @@ -105,6 +105,15 @@ Sequence Protocol equivalent to the Python expression ``value in o``. +.. c:function:: int PySequence_In(PyObject *o, PyObject *value) + + Alias for :c:func:`PySequence_Contains`. + + .. deprecated:: 3.14 + The function is :term:`soft deprecated` and should no longer be used to + write new code. + + .. c:function:: Py_ssize_t PySequence_Index(PyObject *o, PyObject *value) Return the first index *i* for which ``o[i] == value``. On error, return diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index 0959492..d13cd2d 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -1073,6 +1073,10 @@ Deprecated :c:macro:`!isfinite` available from :file:`math.h` since C99. (Contributed by Sergey B Kirpichev in :gh:`119613`.) +* The previously undocumented function :c:func:`PySequence_In` is :term:`soft deprecated`. + Use :c:func:`PySequence_Contains` instead. + (Contributed by Yuki Kobayashi in :gh:`127896`.) + .. Add C API deprecations above alphabetically, not here at the end. .. include:: ../deprecations/c-api-pending-removal-in-3.15.rst diff --git a/Misc/NEWS.d/next/C_API/2024-12-16-07-12-15.gh-issue-127896.HmI9pk.rst b/Misc/NEWS.d/next/C_API/2024-12-16-07-12-15.gh-issue-127896.HmI9pk.rst new file mode 100644 index 0000000..82b4f56 --- /dev/null +++ b/Misc/NEWS.d/next/C_API/2024-12-16-07-12-15.gh-issue-127896.HmI9pk.rst @@ -0,0 +1,2 @@ +The previously undocumented function :c:func:`PySequence_In` is :term:`soft deprecated`. +Use :c:func:`PySequence_Contains` instead. |