Hi all,
I’m learning heap allocated types work by studying examples in the standard library. The documentation for tp_traverse states that:
Heap types (
Py_TPFLAGS_HEAPTYPE) must visit their type with:Py_VISIT(Py_TYPE(self));
However, inside ZstdCompressor, this doesn’t seem to be the case. Likewise for ZstdDecompressor.
static int
ZstdCompressor_traverse(PyObject *ob, visitproc visit, void *arg)
{
ZstdCompressor *self = ZstdCompressor_CAST(ob);
Py_VISIT(self->dict);
return 0;
}
Since the two types are heap allocated types, it seems that this goes against the documentation. Might anyone clarify the situation? Much appreciated.
Cheers