Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Feature or enhancement
Proposal:
In#132070, there was a race brought up in free-threading through use ofPy_REFCNT(op) == 1. The fix is to use_PyObject_IsUniquelyReferenced.
There were a couple additional comments about how we should handle this for the public API (for example,@godlygeek suggested implementingPy_REFCNT as_PyObject_IsUniquelyReferenced(op) ? 1 : INT_MAX). I think the best approach is to just expose an unstable API for this and point to it inPy_REFCNT's documentation.
I'm not imagining anything complex:
intPyUnstable_Object_IsUniquelyReferenced(PyObject*op){return_PyObject_IsUniquelyReferenced(op);}
@encukou, do you mind if this skips the C API WG? I'm not sure there's much to discuss about the API, other than some light bikeshedding.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response