Adding C API for use in tp_traverse

I think that’s just PyType_GetBaseByToken and PyType_GetModuleByToken. It seems pretty rare to need to call them from a tp_traverse handler. If really necessary, I think you can work around that in extensions by calling other APIs.

If there were a few extensions that would make use of it, I’d say to add those two with _Borrow or _GCSafe suffixes, but I’m not sure it’s worth it right now.

1 Like