gh-144161: Clarify additional immortalization in free-threaded build#144176
gh-144161: Clarify additional immortalization in free-threaded build#144176HernaniSamuel wants to merge 11 commits intopython:mainfrom
Conversation
…build Clarify that the objects listed in the free-threading HOWTO are additional immortalizations specific to the free-threaded build. This addresses the inconsistency with sys.intern() documentation, which describes the default (mortal) behavior.
ZeroIntensity
left a comment
There was a problem hiding this comment.
I think it would make much more sense to just add a note to sys.intern and PyUnicode_InternInPlace saying that the free-threaded build makes all interned strings immortal.
Doc/c-api/unicode.rst
Outdated
| You must keep a reference to the result to benefit from interning. | ||
|
|
||
| .. note:: | ||
| On the free-threaded build, all interned strings are :term:`immortal`. |
There was a problem hiding this comment.
Sorry I messed up the suggestion, the right term is "free threading":
| On the free-threaded build, all interned strings are :term:`immortal`. | |
| On the :term:`free threaded <free threading>` build, all interned strings are :term:`immortal`. |
This comment was marked as outdated.
This comment was marked as outdated.
"free threaded" is the more common spelling in the docs: |
I confirm. No hyphen should be used, see the issue gh-144277. |
|
In this PR preposition was changed from "in the free threaded build" to "on the free threaded build". I believe that "in" is more correct because it can be rephrased as "inside the free threaded build" unlike "on" version. Quick check with LLM also told me that, but perhaps I am missing something. |
|
Did you intend to close the PR? |
|
Yes — I don’t plan to continue working on it. Feel free to reopen if someone wants to pick it up. |
Clarify that the objects listed in the free-threading HOWTO are additional immortalizations specific to the free-threaded build.
This addresses the inconsistency reported in #144161, where
sys.intern()documentation states that interned strings are not immortal, while the free-threading HOWTO suggested otherwise. Both are correct for their respective contexts (default vs. free-threaded builds).Changes follow the suggestion by @Prometheus3375 in the issue discussion.
📚 Documentation preview 📚: https://cpython-previews--144176.org.readthedocs.build/