]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-142217: Recommend PyUnicode_InternFromString() to replace _PyUnicode_FromId()...
authorVictor Stinner <vstinner@python.org>
Mon, 15 Dec 2025 13:25:30 +0000 (14:25 +0100)
committerGitHub <noreply@github.com>
Mon, 15 Dec 2025 13:25:30 +0000 (14:25 +0100)
Doc/deprecations/c-api-pending-removal-in-3.20.rst
Doc/whatsnew/3.15.rst
Misc/NEWS.d/next/C_API/2025-12-03-14-41-07.gh-issue-141049.VuAUe2.rst

index a813cb21dd4dbffb2a31ad1d5b11a92bba89accd..8de55bbe7e695c36f916e3914c10e07a0aa59094 100644 (file)
@@ -3,7 +3,7 @@ Pending removal in Python 3.20
 
 * :c:func:`!_PyObject_CallMethodId`, :c:func:`!_PyObject_GetAttrId` and
   :c:func:`!_PyUnicode_FromId` are deprecated since 3.15 and will be removed in
-  3.20. Instead, use :c:func:`PyUnicode_FromString()` and cache the result in
+  3.20. Instead, use :c:func:`PyUnicode_InternFromString()` and cache the result in
   the module state, then call :c:func:`PyObject_CallMethod` or
   :c:func:`PyObject_GetAttr`.
   (Contributed by Victor Stinner in :gh:`141049`.)
index ccf6c76f1e0fa53635ee53184b8541969b013af0..19762584ef798c709af131fd7c0d502e7160f6fb 100644 (file)
@@ -1226,7 +1226,7 @@ Deprecated C APIs
 
 * :c:func:`!_PyObject_CallMethodId`, :c:func:`!_PyObject_GetAttrId` and
   :c:func:`!_PyUnicode_FromId` are deprecated since 3.15 and will be removed in
-  3.20. Instead, use :c:func:`PyUnicode_FromString()` and cache the result in
+  3.20. Instead, use :c:func:`PyUnicode_InternFromString()` and cache the result in
   the module state, then call :c:func:`PyObject_CallMethod` or
   :c:func:`PyObject_GetAttr`.
   (Contributed by Victor Stinner in :gh:`141049`.)
index b0fcd24d4142701b36fb05660b2265ca019db644..77cd5220d52fef9c2f142eefc7a15cab1d6268f6 100644 (file)
@@ -1,5 +1,5 @@
 :c:func:`!_PyObject_CallMethodId`, :c:func:`!_PyObject_GetAttrId` and
 :c:func:`!_PyUnicode_FromId` are deprecated since 3.15 and will be removed in
-3.20. Instead, use :c:func:`PyUnicode_FromString()` and cache the result in
+3.20. Instead, use :c:func:`PyUnicode_InternFromString()` and cache the result in
 the module state, then call :c:func:`PyObject_CallMethod` or
 :c:func:`PyObject_GetAttr`. Patch by Victor Stinner.