Skip to content

Conversation

ngoldbaum
Copy link
Contributor

Adds a shim for PyUnstable_Object_IsUniquelyReferenced and a test for the shim.

I'd like to use this function in a few libraries but don't want to have to have a thread-unsafe check in 3.13 or add new uses of internal headers outside of the compat header here.

I'm not sure whether the using stuff from internal headers is ok in a shim like this. I'm also not sure if you want to avoid PyUnstable functions in the compat headers.

The implementation is copy/pasted from the implementation of _PyObject_IsUniquelyReferenced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant