From 312bb44ba81e333452799e9ee3c72fb4c911fe14 Mon Sep 17 00:00:00 2001 From: Yuki Kobayashi Date: Tue, 10 Dec 2024 05:36:24 +0000 Subject: [PATCH 1/7] gh-127896: Add missing document of `PySequence_In` --- Doc/c-api/sequence.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/c-api/sequence.rst b/Doc/c-api/sequence.rst index ce28839f5ba739..b7d78349a35039 100644 --- a/Doc/c-api/sequence.rst +++ b/Doc/c-api/sequence.rst @@ -105,6 +105,11 @@ Sequence Protocol equivalent to the Python expression ``value in o``. +.. c:function:: int PySequence_In(PyObject *o, PyObject *value) + + Deprecated alias for :c:func:`PySequence_Contains`. + + .. c:function:: Py_ssize_t PySequence_Index(PyObject *o, PyObject *value) Return the first index *i* for which ``o[i] == value``. On error, return From 2751a7645fb5f64eb2a98ad4c835f03e82f0ecea Mon Sep 17 00:00:00 2001 From: Yuki Kobayashi Date: Mon, 16 Dec 2024 15:10:26 +0900 Subject: [PATCH 2/7] Update Doc/c-api/sequence.rst Co-authored-by: Sergey B Kirpichev --- Doc/c-api/sequence.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Doc/c-api/sequence.rst b/Doc/c-api/sequence.rst index b7d78349a35039..df5bf6b64a93a0 100644 --- a/Doc/c-api/sequence.rst +++ b/Doc/c-api/sequence.rst @@ -107,7 +107,11 @@ Sequence Protocol .. c:function:: int PySequence_In(PyObject *o, PyObject *value) - Deprecated alias for :c:func:`PySequence_Contains`. + 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) From dfe64b0b16e74e3457b15d7b9e3fe24bdc868caa Mon Sep 17 00:00:00 2001 From: Yuki Kobayashi Date: Mon, 16 Dec 2024 07:22:35 +0000 Subject: [PATCH 3/7] Add news and whatsnew entry --- Doc/whatsnew/3.14.rst | 4 ++++ .../next/C_API/2024-12-16-07-12-15.gh-issue-127896.HmI9pk.rst | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 Misc/NEWS.d/next/C_API/2024-12-16-07-12-15.gh-issue-127896.HmI9pk.rst diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index 095949242c09d9..73bc8f0379f789 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`.) ++ :c:function:`!PySequence_In` function is :term:`soft deprecated`. + Use :c:function:`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 00000000000000..132ff01606527a --- /dev/null +++ b/Misc/NEWS.d/next/C_API/2024-12-16-07-12-15.gh-issue-127896.HmI9pk.rst @@ -0,0 +1,2 @@ +:c:function:`!PySequence_In` function is :term:`soft deprecated`. +Use :c:function:`PySequence_Contains` instead. From 59f43d368a401a7b812ac05d14b52bfd065d9c9a Mon Sep 17 00:00:00 2001 From: Yuki Kobayashi Date: Mon, 16 Dec 2024 07:58:48 +0000 Subject: [PATCH 4/7] Fixup --- Doc/whatsnew/3.14.rst | 4 ++-- .../next/C_API/2024-12-16-07-12-15.gh-issue-127896.HmI9pk.rst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index 73bc8f0379f789..d10b96c37ac54d 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -1073,8 +1073,8 @@ Deprecated :c:macro:`!isfinite` available from :file:`math.h` since C99. (Contributed by Sergey B Kirpichev in :gh:`119613`.) -+ :c:function:`!PySequence_In` function is :term:`soft deprecated`. - Use :c:function:`PySequence_Contains` instead. ++ :c:func:`!PySequence_In` function 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. 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 index 132ff01606527a..7172973f10074d 100644 --- 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 @@ -1,2 +1,2 @@ -:c:function:`!PySequence_In` function is :term:`soft deprecated`. -Use :c:function:`PySequence_Contains` instead. +:c:func:`!PySequence_In` function is :term:`soft deprecated`. +Use :c:func:`PySequence_Contains` instead. From 4b752e96e7a0408beadb46e35ae1a164fcdc5458 Mon Sep 17 00:00:00 2001 From: Yuki Kobayashi Date: Mon, 16 Dec 2024 19:14:29 +0900 Subject: [PATCH 5/7] Update Doc/whatsnew/3.14.rst Co-authored-by: Petr Viktorin --- Doc/whatsnew/3.14.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index d10b96c37ac54d..6bbf08597ef371 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -1073,7 +1073,7 @@ Deprecated :c:macro:`!isfinite` available from :file:`math.h` since C99. (Contributed by Sergey B Kirpichev in :gh:`119613`.) -+ :c:func:`!PySequence_In` function is :term:`soft deprecated`. ++ 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`.) From b40afc1a5a45fed8894334828d2f012e868865e4 Mon Sep 17 00:00:00 2001 From: Yuki Kobayashi Date: Mon, 16 Dec 2024 19:16:58 +0900 Subject: [PATCH 6/7] Update 2024-12-16-07-12-15.gh-issue-127896.HmI9pk.rst --- .../next/C_API/2024-12-16-07-12-15.gh-issue-127896.HmI9pk.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 7172973f10074d..82b4f563591fe1 100644 --- 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 @@ -1,2 +1,2 @@ -:c:func:`!PySequence_In` function is :term:`soft deprecated`. +The previously undocumented function :c:func:`PySequence_In` is :term:`soft deprecated`. Use :c:func:`PySequence_Contains` instead. From d45aace21210d800f496569c5441773bbface3ce Mon Sep 17 00:00:00 2001 From: Yuki Kobayashi Date: Mon, 16 Dec 2024 19:17:51 +0900 Subject: [PATCH 7/7] Update 3.14.rst --- Doc/whatsnew/3.14.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index 6bbf08597ef371..d13cd2d5173a04 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -1073,7 +1073,7 @@ 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`. +* 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`.)