Getting exceptions & built-in types using `Py_GetConstant`
Discussions on Python.org
Getting exceptions & built-in types using `Py_GetConstant`
I propose defining identifiers for use with Py_GetConstant for exceptions (e.g. Py_CONSTANT_Exc_ValueError to get ValueError) and other built-in types (e.g. Py_CONSTANT_Bool_Type to get bool). When compiling for Stable ABI 3.16+, the current API will be defined via calls to Py_GetConstant(). For example: #define PyExc_ArithmeticError (Py_GetConstantBorrowed(Py_CONSTANT_Exc_ArithmeticError)) #define PyBool_Type (*(PyTypeObject*)Py_GetConstantBorrowed(Py_CONSTANT_Bool_Type)) This means they c...
0 comments
No comments yet.