summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-10-02 17:24:08 (GMT)
committerGitHub <noreply@github.com>2023-10-02 17:24:08 (GMT)
commitfc2cb86d210555d509debaeefd370d5331cd9d93 (patch)
treeebbe2b02c0ff0b0c0cab825b52d79ccf3e99fb18 /Objects
parent6387b5313c60c1403785b2245db33372476ac304 (diff)
downloadcpython-fc2cb86d210555d509debaeefd370d5331cd9d93.zip
cpython-fc2cb86d210555d509debaeefd370d5331cd9d93.tar.gz
cpython-fc2cb86d210555d509debaeefd370d5331cd9d93.tar.bz2
gh-107073: Make PyObject_VisitManagedDict() public (#108763)
Make PyObject_VisitManagedDict() and PyObject_ClearManagedDict() functions public in Python 3.13 C API. * Rename _PyObject_VisitManagedDict() to PyObject_VisitManagedDict(). * Rename _PyObject_ClearManagedDict() to PyObject_ClearManagedDict(). * Document these functions.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/dictobject.c4
-rw-r--r--Objects/typeobject.c4
-rw-r--r--Objects/typevarobject.c18
3 files changed, 13 insertions, 13 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 1fb795f..361f8e9 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -5649,7 +5649,7 @@ _PyObject_FreeInstanceAttributes(PyObject *self)
}
int
-_PyObject_VisitManagedDict(PyObject *obj, visitproc visit, void *arg)
+PyObject_VisitManagedDict(PyObject *obj, visitproc visit, void *arg)
{
PyTypeObject *tp = Py_TYPE(obj);
if((tp->tp_flags & Py_TPFLAGS_MANAGED_DICT) == 0) {
@@ -5672,7 +5672,7 @@ _PyObject_VisitManagedDict(PyObject *obj, visitproc visit, void *arg)
}
void
-_PyObject_ClearManagedDict(PyObject *obj)
+PyObject_ClearManagedDict(PyObject *obj)
{
PyTypeObject *tp = Py_TYPE(obj);
if((tp->tp_flags & Py_TPFLAGS_MANAGED_DICT) == 0) {
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 893d842..3261a14 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -1835,7 +1835,7 @@ subtype_traverse(PyObject *self, visitproc visit, void *arg)
assert(base->tp_dictoffset == 0);
if (type->tp_flags & Py_TPFLAGS_MANAGED_DICT) {
assert(type->tp_dictoffset == -1);
- int err = _PyObject_VisitManagedDict(self, visit, arg);
+ int err = PyObject_VisitManagedDict(self, visit, arg);
if (err) {
return err;
}
@@ -1905,7 +1905,7 @@ subtype_clear(PyObject *self)
__dict__ slots (as in the case 'self.__dict__ is self'). */
if (type->tp_flags & Py_TPFLAGS_MANAGED_DICT) {
if ((base->tp_flags & Py_TPFLAGS_MANAGED_DICT) == 0) {
- _PyObject_ClearManagedDict(self);
+ PyObject_ClearManagedDict(self);
}
}
else if (type->tp_dictoffset != base->tp_dictoffset) {
diff --git a/Objects/typevarobject.c b/Objects/typevarobject.c
index 0f04523..73cdf48 100644
--- a/Objects/typevarobject.c
+++ b/Objects/typevarobject.c
@@ -200,7 +200,7 @@ typevar_dealloc(PyObject *self)
Py_XDECREF(tv->evaluate_bound);
Py_XDECREF(tv->constraints);
Py_XDECREF(tv->evaluate_constraints);
- _PyObject_ClearManagedDict(self);
+ PyObject_ClearManagedDict(self);
PyObject_ClearWeakRefs(self);
Py_TYPE(self)->tp_free(self);
@@ -216,7 +216,7 @@ typevar_traverse(PyObject *self, visitproc visit, void *arg)
Py_VISIT(tv->evaluate_bound);
Py_VISIT(tv->constraints);
Py_VISIT(tv->evaluate_constraints);
- _PyObject_VisitManagedDict(self, visit, arg);
+ PyObject_VisitManagedDict(self, visit, arg);
return 0;
}
@@ -227,7 +227,7 @@ typevar_clear(typevarobject *self)
Py_CLEAR(self->evaluate_bound);
Py_CLEAR(self->constraints);
Py_CLEAR(self->evaluate_constraints);
- _PyObject_ClearManagedDict((PyObject *)self);
+ PyObject_ClearManagedDict((PyObject *)self);
return 0;
}
@@ -744,7 +744,7 @@ paramspec_dealloc(PyObject *self)
Py_DECREF(ps->name);
Py_XDECREF(ps->bound);
- _PyObject_ClearManagedDict(self);
+ PyObject_ClearManagedDict(self);
PyObject_ClearWeakRefs(self);
Py_TYPE(self)->tp_free(self);
@@ -757,7 +757,7 @@ paramspec_traverse(PyObject *self, visitproc visit, void *arg)
Py_VISIT(Py_TYPE(self));
paramspecobject *ps = (paramspecobject *)self;
Py_VISIT(ps->bound);
- _PyObject_VisitManagedDict(self, visit, arg);
+ PyObject_VisitManagedDict(self, visit, arg);
return 0;
}
@@ -765,7 +765,7 @@ static int
paramspec_clear(paramspecobject *self)
{
Py_CLEAR(self->bound);
- _PyObject_ClearManagedDict((PyObject *)self);
+ PyObject_ClearManagedDict((PyObject *)self);
return 0;
}
@@ -1026,7 +1026,7 @@ typevartuple_dealloc(PyObject *self)
typevartupleobject *tvt = (typevartupleobject *)self;
Py_DECREF(tvt->name);
- _PyObject_ClearManagedDict(self);
+ PyObject_ClearManagedDict(self);
PyObject_ClearWeakRefs(self);
Py_TYPE(self)->tp_free(self);
@@ -1165,14 +1165,14 @@ static int
typevartuple_traverse(PyObject *self, visitproc visit, void *arg)
{
Py_VISIT(Py_TYPE(self));
- _PyObject_VisitManagedDict(self, visit, arg);
+ PyObject_VisitManagedDict(self, visit, arg);
return 0;
}
static int
typevartuple_clear(PyObject *self)
{
- _PyObject_ClearManagedDict(self);
+ PyObject_ClearManagedDict(self);
return 0;
}