diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index d2b6643c700e88..307e6f73d03eb8 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -1750,9 +1750,12 @@ They all return ``NULL`` or ``-1`` if an exception occurs. :c:expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, then -- as with any other error -- the argument is left unchanged. - Note that interned strings are not “immortal”. + Strings interned by this function are not :term:`immortal`. You must keep a reference to the result to benefit from interning. + .. note:: + On the free-threaded build, all interned strings are :term:`immortal`. + This may change in the future. .. c:function:: PyObject* PyUnicode_InternFromString(const char *str) diff --git a/Doc/howto/free-threading-python.rst b/Doc/howto/free-threading-python.rst index 380c2be04957d5..e7fd5247cfd98d 100644 --- a/Doc/howto/free-threading-python.rst +++ b/Doc/howto/free-threading-python.rst @@ -99,12 +99,12 @@ This section describes known limitations of the free-threaded CPython build. Immortalization --------------- -In the free-threaded build, some objects are :term:`immortal`. +On the free-threaded build, more objects are made immortal. Immortal objects are not deallocated and have reference counts that are never modified. This is done to avoid reference count contention that would prevent efficient multi-threaded scaling. -As of the 3.14 release, immortalization is limited to: +As of the 3.14 release, this additional immortalization is limited to: * Code constants: numeric literals, string literals, and tuple literals composed of other constants. diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index f977f1389b61a5..3644ce1479578c 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1325,6 +1325,9 @@ always available. Unless explicitly noted otherwise, all variables are read-only Interned strings are not :term:`immortal`; you must keep a reference to the return value of :func:`intern` around to benefit from it. + .. note:: + On the free-threaded build, all interned strings are :term:`immortal`. + This may change in the future. .. function:: _is_gil_enabled()