Message365932
> Now we changed rules. A strong reference is created implicitly. Who is responsible to manage a strong reference? Whose who created it, ant it is the interpreter, not the user.
Even if we decide that the patch that introduced the new rules should not be reverted, then what we should do is wrap the tp_traverse of the user in something that also calls Py_VISIT(Py_TYPE(self)) so basically the tp_traverse of the type created by PyType_FromSpec will do
static int
PyType_FromSpec_tp_traverse(_abc_data *self, visitproc visit, void *arg)
{
Py_VISIT(Py_TYPE(self))
return self->user_provided_tp_traverse(self, visit, arg);
}
That way, we can still reason about what the tp_traverse should do, we don't break more rules and we don't need to make maintaining the GC even more difficult. |
|
Date |
User |
Action |
Args |
2020-04-07 18:15:29 | pablogsal | set | recipients:
+ pablogsal, tim.peters, vstinner, serhiy.storchaka, corona10, shihai1991 |
2020-04-07 18:15:28 | pablogsal | set | messageid: <1586283328.97.0.26511764093.issue40217@roundup.psfhosted.org> |
2020-04-07 18:15:28 | pablogsal | link | issue40217 messages |
2020-04-07 18:15:28 | pablogsal | create | |
|