[issue41692] Deprecate immortal interned strings: PyUnicode_InternImmortal()

STINNER Victor report at bugs.python.org
Wed Dec 8 06:28:35 EST 2021


STINNER Victor <vstinner at python.org> added the comment:

I cannot find "PyUnicode_InternImmortal" pattern in the source code of the PyPI top 5000 projects (December 1, 2021).

I only found a false positive in frozendict-2.1.1:

frozendict/src/3_10/cpython_src/Include/unicodeobject.h: // PyUnicode_InternImmortal() is deprecated since Python 3.10
frozendict/src/3_10/cpython_src/Include/unicodeobject.h: Py_DEPRECATED(3.10) PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **);
frozendict/src/3_6/cpython_src/Include/unicodeobject.h: PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **);
frozendict/src/3_7/cpython_src/Include/unicodeobject.h: PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **);
frozendict/src/3_8/cpython_src/Include/unicodeobject.h: PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **);
frozendict/src/3_9/cpython_src/Include/unicodeobject.h: PyAPI_FUNC(void) PyUnicode_InternImmortal(PyObject **);

These are copies of the Python unicodeobject.h header files, but the PyUnicode_InternImmortal() function is not called by frozendict.

I used my download_pypi_top.py and search_pypi_top.py tools which can be found at:
https://github.com/vstinner/misc/tree/main/cpython

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41692>
_______________________________________


More information about the Python-bugs-list mailing list