We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d4ba73c commit ba0d061Copy full SHA for ba0d061
1 file changed
Include/funcobject.h
@@ -56,6 +56,15 @@ extern PyObject *PyFunction_GetGlobals Py_PROTO((PyObject *));
56
extern PyObject *PyFunction_GetDefaults Py_PROTO((PyObject *));
57
extern int PyFunction_SetDefaults Py_PROTO((PyObject *, PyObject *));
58
59
+/* Macros for direct access to these values. Type checks are *not*
60
+ done, so use with care. */
61
+#define PyFunction_GET_CODE(func) \
62
+ (((PyFunctionObject *)func) -> func_code)
63
+#define PyFunction_GET_GLOBALS(func) \
64
+ (((PyFunctionObject *)func) -> func_globals)
65
+#define PyFunction_GET_DEFAULTS(func) \
66
+ (((PyFunctionObject *)func) -> func_defaults)
67
+
68
#ifdef __cplusplus
69
}
70
#endif
0 commit comments