| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Can you please rebase your PR on the updated main branch to get tests on Free Threaded builds?
Sorry, something went wrong.
| } | ||
| #endif | ||
|
|
||
| #ifndef PYPY_VERSION |
There was a problem hiding this comment.
The function doesn't make sense on PyPy?
Sorry, something went wrong.
There was a problem hiding this comment.
Apparently not, maybe an interned string? I rewrote it to use an empty tuple and that seems to work on PyPy.
Sorry, something went wrong.
There was a problem hiding this comment.
I rewrote it to use an empty tuple and that seems to work on PyPy.
but that seems to have broken other builds, let me see if I can get it working everywhere...
Sorry, something went wrong.
|
Tests fail on Python 2: python2.7: test_pythoncapi_compat_cext.c:1983: test_uniquely_referenced: Assertion `PyUnstable_Object_IsUniquelyReferenced(obj)' failed. |
Sorry, something went wrong.
I guess empty tuples have had reference counting optimizations for a long time! |
Sorry, something went wrong.
|
Please update also the doc:
|
Sorry, something went wrong.
|
Merged, thanks for your contribution. I'm not very excited by adding PyUnstable functions to pythoncapi-compat, but I'm fine with this specific function. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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.