summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Include/funcobject.h
diff options
context:
space:
mode:
authorshadchin <[email protected]>2022-04-18 12:39:32 +0300
committershadchin <[email protected]>2022-04-18 12:39:32 +0300
commitd4be68e361f4258cf0848fc70018dfe37a2acc24 (patch)
tree153e294cd97ac8b5d7a989612704a0c1f58e8ad4 /contrib/tools/python3/src/Include/funcobject.h
parent260c02f5ccf242d9d9b8a873afaf6588c00237d6 (diff)
IGNIETFERRO-1816 Update Python 3 from 3.9.12 to 3.10.4
ref:9f96be6d02ee8044fdd6f124b799b270c20ce641
Diffstat (limited to 'contrib/tools/python3/src/Include/funcobject.h')
-rw-r--r--contrib/tools/python3/src/Include/funcobject.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/contrib/tools/python3/src/Include/funcobject.h b/contrib/tools/python3/src/Include/funcobject.h
index c5cc9d261a3..d7acd18c651 100644
--- a/contrib/tools/python3/src/Include/funcobject.h
+++ b/contrib/tools/python3/src/Include/funcobject.h
@@ -7,6 +7,21 @@
extern "C" {
#endif
+
+#define COMMON_FIELDS(PREFIX) \
+ PyObject *PREFIX ## globals; \
+ PyObject *PREFIX ## builtins; \
+ PyObject *PREFIX ## name; \
+ PyObject *PREFIX ## qualname; \
+ PyObject *PREFIX ## code; /* A code object, the __code__ attribute */ \
+ PyObject *PREFIX ## defaults; /* NULL or a tuple */ \
+ PyObject *PREFIX ## kwdefaults; /* NULL or a dict */ \
+ PyObject *PREFIX ## closure; /* NULL or a tuple of cell objects */
+
+typedef struct {
+ COMMON_FIELDS(fc_)
+} PyFrameConstructor;
+
/* Function objects and code objects should not be confused with each other:
*
* Function objects are created by the execution of the 'def' statement.
@@ -20,18 +35,12 @@ extern "C" {
typedef struct {
PyObject_HEAD
- PyObject *func_code; /* A code object, the __code__ attribute */
- PyObject *func_globals; /* A dictionary (other mappings won't do) */
- PyObject *func_defaults; /* NULL or a tuple */
- PyObject *func_kwdefaults; /* NULL or a dict */
- PyObject *func_closure; /* NULL or a tuple of cell objects */
+ COMMON_FIELDS(func_)
PyObject *func_doc; /* The __doc__ attribute, can be anything */
- PyObject *func_name; /* The __name__ attribute, a string object */
PyObject *func_dict; /* The __dict__ attribute, a dict or NULL */
PyObject *func_weakreflist; /* List of weak references */
PyObject *func_module; /* The __module__ attribute, can be anything */
PyObject *func_annotations; /* Annotations, a dict or NULL */
- PyObject *func_qualname; /* The qualified name */
vectorcallfunc vectorcall;
/* Invariant:
@@ -84,6 +93,9 @@ PyAPI_FUNC(PyObject *) _PyFunction_Vectorcall(
#define PyFunction_GET_ANNOTATIONS(func) \
(((PyFunctionObject *)func) -> func_annotations)
+#define PyFunction_AS_FRAME_CONSTRUCTOR(func) \
+ ((PyFrameConstructor *)&((PyFunctionObject *)(func))->func_globals)
+
/* The classmethod and staticmethod types lives here, too */
PyAPI_DATA(PyTypeObject) PyClassMethod_Type;
PyAPI_DATA(PyTypeObject) PyStaticMethod_Type;