]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-118789: Restore hidden `_PyWeakref_ClearRef` (GH-118797) (GH-118903)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 10 May 2024 14:20:22 +0000 (16:20 +0200)
committerGitHub <noreply@github.com>
Fri, 10 May 2024 14:20:22 +0000 (14:20 +0000)
commitbb5bf2422618506dca45912bd174d02b40b4113c
treeef3ac14e08283feaf1fb57fbb9e35743c1617c87
parent93fce2dcd5198fc742971e4aed0f023aa63c92fb
[3.13] gh-118789: Restore hidden `_PyWeakref_ClearRef` (GH-118797) (GH-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 db5af7da092409030c9fbe0a3a986bd0ee441b8b)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Include/cpython/weakrefobject.h
Include/internal/pycore_weakref.h
Misc/NEWS.d/next/C API/2024-05-08-20-13-00.gh-issue-118789.m88uUa.rst [new file with mode: 0644]