]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-127896: Add missing documentation of `PySequence_In` (GH-127979)
authorYuki Kobayashi <drsuaimqjgar@gmail.com>
Mon, 16 Dec 2024 13:56:04 +0000 (22:56 +0900)
committerGitHub <noreply@github.com>
Mon, 16 Dec 2024 13:56:04 +0000 (14:56 +0100)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Doc/c-api/sequence.rst
Doc/whatsnew/3.14.rst
Misc/NEWS.d/next/C_API/2024-12-16-07-12-15.gh-issue-127896.HmI9pk.rst [new file with mode: 0644]

index ce28839f5ba739d4ace7832a97ae122b4749cd4e..df5bf6b64a93a0088652fa588005062f7b80b7a2 100644 (file)
@@ -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
index 095949242c09d9ffedc940351d43fcb5ff354b26..d13cd2d5173a04b7ef8efde82be9983553774587 100644 (file)
@@ -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 (file)
index 0000000..82b4f56
--- /dev/null
@@ -0,0 +1,2 @@
+The previously undocumented function :c:func:`PySequence_In` is :term:`soft deprecated`.
+Use :c:func:`PySequence_Contains` instead.