gh-107149: Make PyUnstable_ExecutableKinds public (#108440) · python/cpython@9c03215

GitHub

Original file line numberDiff line numberDiff line change@@ -33,3 +33,11 @@ PyAPI_FUNC(int) PyUnstable_InterpreterFrame_GetLasti(struct _PyInterpreterFrame

3333/* Returns the currently executing line number, or -1 if there is no line number.

3434 * Does not raise an exception. */

3535PyAPI_FUNC(int) PyUnstable_InterpreterFrame_GetLine(struct_PyInterpreterFrame*frame);

36+37+#definePyUnstable_EXECUTABLE_KIND_SKIP 0

38+#definePyUnstable_EXECUTABLE_KIND_PY_FUNCTION 1

39+#definePyUnstable_EXECUTABLE_KIND_BUILTIN_FUNCTION 3

40+#definePyUnstable_EXECUTABLE_KIND_METHOD_DESCRIPTOR 4

41+#definePyUnstable_EXECUTABLE_KINDS 5

42+43+PyAPI_DATA(constPyTypeObject*) constPyUnstable_ExecutableKinds[PyUnstable_EXECUTABLE_KINDS+1];

Original file line numberDiff line numberDiff line change@@ -311,14 +311,6 @@ PyGenObject *_PyFrame_GetGenerator(_PyInterpreterFrame *frame)

311311return (PyGenObject*)(((char*)frame) -offset_in_gen);

312312}

313313314-#definePY_EXECUTABLE_KIND_SKIP 0

315-#definePY_EXECUTABLE_KIND_PY_FUNCTION 1

316-#definePY_EXECUTABLE_KIND_BUILTIN_FUNCTION 3

317-#definePY_EXECUTABLE_KIND_METHOD_DESCRIPTOR 4

318-#definePY_EXECUTABLE_KINDS 5

319-320-PyAPI_DATA(constPyTypeObject*) constPyUnstable_ExecutableKinds[PY_EXECUTABLE_KINDS+1];

321-322314#ifdef__cplusplus

323315}

324316#endif

Original file line numberDiff line numberDiff line change@@ -167,10 +167,10 @@ PyUnstable_InterpreterFrame_GetLine(_PyInterpreterFrame *frame)

167167returnPyCode_Addr2Line(_PyFrame_GetCode(frame), addr);

168168}

169169170-constPyTypeObject*constPyUnstable_ExecutableKinds[PY_EXECUTABLE_KINDS+1] = {

171- [PY_EXECUTABLE_KIND_SKIP] =&_PyNone_Type,

172- [PY_EXECUTABLE_KIND_PY_FUNCTION] =&PyCode_Type,

173- [PY_EXECUTABLE_KIND_BUILTIN_FUNCTION] =&PyMethod_Type,

174- [PY_EXECUTABLE_KIND_METHOD_DESCRIPTOR] =&PyMethodDescr_Type,

175- [PY_EXECUTABLE_KINDS] =NULL,

170+constPyTypeObject*constPyUnstable_ExecutableKinds[PyUnstable_EXECUTABLE_KINDS+1] = {

171+ [PyUnstable_EXECUTABLE_KIND_SKIP] =&_PyNone_Type,

172+ [PyUnstable_EXECUTABLE_KIND_PY_FUNCTION] =&PyCode_Type,

173+ [PyUnstable_EXECUTABLE_KIND_BUILTIN_FUNCTION] =&PyMethod_Type,

174+ [PyUnstable_EXECUTABLE_KIND_METHOD_DESCRIPTOR] =&PyMethodDescr_Type,

175+ [PyUnstable_EXECUTABLE_KINDS] =NULL,

176176};