]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-113993: Don't immortalize in PyUnicode_InternInPlace; keep immortalizing in other...
authorPetr Viktorin <encukou@gmail.com>
Tue, 16 Jul 2024 13:36:21 +0000 (15:36 +0200)
committerGitHub <noreply@github.com>
Tue, 16 Jul 2024 13:36:21 +0000 (15:36 +0200)
commitb4aedb23ae7954fb58084dda16cd41786819a8cf
tree2dbbf03f492051660abe084592a5da66a1badba2
parentd7a099d7ae749798bd822aee5d1d46d0a335189b
gh-113993: Don't immortalize in PyUnicode_InternInPlace; keep immortalizing in other API (#121364)

* Switch PyUnicode_InternInPlace to _PyUnicode_InternMortal, clarify docs

* Document immortality in some functions that take `const char *`

This is PyUnicode_InternFromString;
PyDict_SetItemString, PyObject_SetAttrString;
PyObject_DelAttrString; PyUnicode_InternFromString;
and the PyModule_Add convenience functions.

Always point out a non-immortalizing alternative.

* Don't immortalize user-provided attr names in _ctypes
Doc/c-api/module.rst
Doc/c-api/object.rst
Doc/c-api/unicode.rst
Misc/NEWS.d/next/C API/2024-07-04-15-41-10.gh-issue-113993.cLSiWV.rst [new file with mode: 0644]
Modules/_ctypes/_ctypes.c
Objects/unicodeobject.c