mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Add macros for direct access to the members of CFunction objects.
This commit is contained in:
parent
d4ba73c75b
commit
ba0d0611e7
1 changed files with 9 additions and 0 deletions
|
@ -56,6 +56,15 @@ extern PyObject *PyFunction_GetGlobals Py_PROTO((PyObject *));
|
|||
extern PyObject *PyFunction_GetDefaults Py_PROTO((PyObject *));
|
||||
extern int PyFunction_SetDefaults Py_PROTO((PyObject *, PyObject *));
|
||||
|
||||
/* Macros for direct access to these values. Type checks are *not*
|
||||
done, so use with care. */
|
||||
#define PyFunction_GET_CODE(func) \
|
||||
(((PyFunctionObject *)func) -> func_code)
|
||||
#define PyFunction_GET_GLOBALS(func) \
|
||||
(((PyFunctionObject *)func) -> func_globals)
|
||||
#define PyFunction_GET_DEFAULTS(func) \
|
||||
(((PyFunctionObject *)func) -> func_defaults)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue