einspect
einspect copied to clipboard
feature/enhancement: support `ob_next` and `ob_prev` when built with `Py_TRACE_REFS`
Py_TRACE_REFS
can be dynamically detected, because it defines sys.getobjects
. At import time, you could check for sys.getobjects
and define the extra members on the PyObject struct if it's present.
Note: if this feature is added, it would only apply to python version <= 3.12 -- ob_next
and ob_prev
are present in 3.12 (if built with the right option) but don't seem to be present in the main branch (3.13).