FWIW, I was hoping to the same for PyThreadState but it looks like 6 of its fields are exposed in "stable" header files via the following macros:
# Include/object.h
Py_TRASHCAN_SAFE_BEGIN
Py_TRASHCAN_SAFE_END
Include.ceval.h
Py_EnterRecursiveCall
Py_LeaveRecursiveCall
_Py_MakeRecCheck
Py_ALLOW_RECURSION
Py_END_ALLOW_RECURSION
I'm not sure how that factors into the stable ABI (PyThreadState wasn't ever guarded by Py_LIMITED_API). However, I didn't need to deal with it right now so I'm not going to go there. :) |