8000 gh-111178: Make slot functions in typeobject.c have compatible types by chrstphrchvz · Pull Request #112752 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-111178: Make slot functions in typeobject.c have compatible types #112752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Dec 20, 2023
Prev Previous commit
Next Next commit
Make type_clear() compatible with inquiry
  • Loading branch information
chrstphrchvz authored Dec 5, 2023
commit a8b30d91fba3dc086c20fdc563483cc53d3ce09c
6 changes: 4 additions & 2 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -5292,8 +5292,10 @@ type_traverse(PyObject *self, visitproc visit, void *arg)
}

static int
type_clear(PyTypeObject *type)
type_clear(PyObject *self)
{
PyTypeObject *type = (PyTypeObject *)self;

/* Because of type_is_gc(), the collector only calls this
for heaptypes. */
_PyObject_ASSERT((PyObject *)type, type->tp_flags & Py_TPFLAGS_HEAPTYPE);
Expand Down Expand Up @@ -5376,7 +5378,7 @@ PyTypeObject PyType_Type = {
Py_TPFLAGS_ITEMS_AT_END, /* tp_flags */
type_doc, /* tp_doc */
type_traverse, /* tp_traverse */
(inquiry)type_clear, /* tp_clear */
type_clear, /* tp_clear */
0, /* tp_richcompare */
offsetof(PyTypeObject, tp_weaklist), /* tp_weaklistoffset */
0, /* tp_iter */
Expand Down
0