Uh oh!
There was an error while loading. Please reload this page.
gh-118789: Restore hidden _PyWeakref_ClearRef - #118797
Conversation
_PyWeakref_ClearRef was previously exposed in the public C-API, although it begins with an underscore and is not documented. It's used by a few C-API extensions. There is currently no alternative public API that can replace its use. _PyWeakref_ClearWeakRefsExceptCallbacks is the only thread-safe way to use _PyWeakref_ClearRef in the free-threaded build. This exposes the C symbol, but does not make the API public.
colesbury
commented
May 8, 2024
cc @albanD |
vstinner
left a comment
There was a problem hiding this comment.
Would it be possible to only restore it in Python 3.13 and remove it (do nothing) in Python 3.14, since a replacement is added?
Uh oh!
There was an error while loading. Please reload this page.
encukou
commented
May 9, 2024
That's a question for the C API workgroup. AFAIK, the workflow for 3.13 is to restore the API that causes problems. I don't think 3.14 branching changes that. |
Thanks @colesbury for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
_PyWeakref_ClearRef was previously exposed in the public C-API, although it begins with an underscore and is not documented. It's used by a few C-API extensions. There is currently no alternative public API that can replace its use. _PyWeakref_ClearWeakRefsExceptCallbacks is the only thread-safe way to use _PyWeakref_ClearRef in the free-threaded build. This exposes the C symbol, but does not make the API public. (cherry picked from commit db5af7d) Co-authored-by: Sam Gross <colesbury@gmail.com>
GH-118903 is a backport of this pull request to the 3.13 branch. |
…H-118903) gh-118789: Restore hidden `_PyWeakref_ClearRef` (GH-118797) _PyWeakref_ClearRef was previously exposed in the public C-API, although it begins with an underscore and is not documented. It's used by a few C-API extensions. There is currently no alternative public API that can replace its use. _PyWeakref_ClearWeakRefsExceptCallbacks is the only thread-safe way to use _PyWeakref_ClearRef in the free-threaded build. This exposes the C symbol, but does not make the API public. (cherry picked from commit db5af7d) Co-authored-by: Sam Gross <colesbury@gmail.com>
_PyWeakref_ClearRefwas previously exposed in the public C-API, although it begins with an underscore and is not documented. It's used by a few C-API extensions. There is currently no alternative public API that can replace its use._PyWeakref_ClearRefand_PyWeakref_ClearWeakRefsExceptCallbacksshould be exposed in 3.13 #118789