You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
_PyWeakref_ClearRef and _PyWeakref_ClearWeakRefsExceptCallbacks should be exposed in 3.13 #118789
_PyWeakref_ClearRef was previously exposed in the public C-API. In 3.13, it was moved to pycore_weakref.h and the symbol is not exposed (i.e., it's extern void instead of PyAPI_FUNC(void).
_PyWeakref_ClearRef is used to clear a single weakref without calling its callback. _PyWeakref_ClearWeakRefsExceptCallbacks is the thread-safe version. If people are using _PyWeakref_ClearRef, we'd rather they use _PyWeakref_ClearWeakRefsExceptCallbacks so that the code is thread-safe in the free-threading build.
One use case is to clear newly added weakrefs after you've called a finalizer, in case your C type does not delegate to subtype_dealloc.
At a minimum, we should add PyAPI_FUNC to _PyWeakref_ClearRef and _PyWeakref_ClearWeakRefsExceptCallbacks and consider making _PyWeakref_ClearWeakRefsExceptCallbacks part of the public C API.
Activity
pythongh-118789: Restore hidden `_PyWeakref_ClearRef`
pythongh-118789: Add `PyUnstable_Weakref_ClearWeakRefsExceptCallbacks`
gh-118789: Restore hidden `_PyWeakref_ClearRef` (#118797)
pythongh-118789: Restore hidden `_PyWeakref_ClearRef` (pythonGH-118797)
[3.13] gh-118789: Restore hidden `_PyWeakref_ClearRef` (GH-118797) (G…
Merge branch 'main' into pythongh-118789-PyUnstable_Weakref_ClearWeak…
gh-118789: Add `PyUnstable_Object_ClearWeakRefsNoCallbacks` (#118807)
pythongh-118789: Add `PyUnstable_Object_ClearWeakRefsNoCallbacks` (py…
[3.13] gh-118789: Add `PyUnstable_Object_ClearWeakRefsNoCallbacks` (G…
pythongh-118789: Add `PyUnstable_Object_ClearWeakRefsNoCallbacks` (py…
pythongh-118789: Add `PyUnstable_Object_ClearWeakRefsNoCallbacks` (py…
pythongh-118789: Add `PyUnstable_Object_ClearWeakRefsNoCallbacks` (py…
pythongh-118789: Add `PyUnstable_Object_ClearWeakRefsNoCallbacks` (py…