mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
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.
This commit is contained in:
parent
6387b5313c
commit
fc2cb86d21
12 changed files with 77 additions and 24 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue