mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-133140: Add PyUnstable_Object_IsUniquelyReferenced
for free-threading (#133144)
This commit is contained in:
parent
0eeaa0ef8b
commit
b275b8f342
8 changed files with 61 additions and 1 deletions
|
@ -478,6 +478,13 @@ clear_managed_dict(PyObject *self, PyObject *obj)
|
|||
}
|
||||
|
||||
|
||||
static PyObject *
|
||||
is_uniquely_referenced(PyObject *self, PyObject *op)
|
||||
{
|
||||
return PyBool_FromLong(PyUnstable_Object_IsUniquelyReferenced(op));
|
||||
}
|
||||
|
||||
|
||||
static PyMethodDef test_methods[] = {
|
||||
{"call_pyobject_print", call_pyobject_print, METH_VARARGS},
|
||||
{"pyobject_print_null", pyobject_print_null, METH_VARARGS},
|
||||
|
@ -503,6 +510,7 @@ static PyMethodDef test_methods[] = {
|
|||
{"test_py_is_macros", test_py_is_macros, METH_NOARGS},
|
||||
{"test_py_is_funcs", test_py_is_funcs, METH_NOARGS},
|
||||
{"clear_managed_dict", clear_managed_dict, METH_O, NULL},
|
||||
{"is_uniquely_referenced", is_uniquely_referenced, METH_O},
|
||||
{NULL},
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue