gh-128008: Add `PyWeakref_IsDead()` (GH-128009)
The `PyWeakref_IsDead()` function tests if a weak reference is dead without any side effects. Although you can also detect if a weak reference is dead using `PyWeakref_GetRef()`, that function returns a strong reference that must be `Py_DECREF()`'d, which can introduce side effects if the last reference is concurrently dropped (at least in the free threading build).
S
Sam Gross committed
7b811d0562a0bf7433165785f1549ac199610f8b
Parent: b9b3e4a
Committed by GitHub <noreply@github.com>
on 12/19/2024, 3:17:15 PM