aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Include/cpython/genobject.h
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.com>2024-02-12 07:53:52 +0300
committershadchin <shadchin@yandex-team.com>2024-02-12 08:07:36 +0300
commitce1b7ca3171f9158180640c6a02a74b4afffedea (patch)
treee47c1e8391b1b0128262c1e9b1e6ed4c8fff2348 /contrib/tools/python3/src/Include/cpython/genobject.h
parent57350d96f030db90f220ce50ee591d5c5d403df7 (diff)
downloadydb-ce1b7ca3171f9158180640c6a02a74b4afffedea.tar.gz
Update Python from 3.11.8 to 3.12.2
Diffstat (limited to 'contrib/tools/python3/src/Include/cpython/genobject.h')
-rw-r--r--contrib/tools/python3/src/Include/cpython/genobject.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/contrib/tools/python3/src/Include/cpython/genobject.h b/contrib/tools/python3/src/Include/cpython/genobject.h
index 40eaa19d3f..7856481b5d 100644
--- a/contrib/tools/python3/src/Include/cpython/genobject.h
+++ b/contrib/tools/python3/src/Include/cpython/genobject.h
@@ -13,8 +13,6 @@ extern "C" {
and coroutine objects. */
#define _PyGenObject_HEAD(prefix) \
PyObject_HEAD \
- /* The code object backing the generator */ \
- PyCodeObject *prefix##_code; \
/* List of weak reference. */ \
PyObject *prefix##_weakreflist; \
/* Name of the generator. */ \
@@ -28,7 +26,7 @@ extern "C" {
char prefix##_running_async; \
/* The frame */ \
int8_t prefix##_frame_state; \
- PyObject *prefix##_iframe[1];
+ PyObject *prefix##_iframe[1]; \
typedef struct {
/* The gi_ prefix is intended to remind of generator-iterator. */
@@ -37,8 +35,8 @@ typedef struct {
PyAPI_DATA(PyTypeObject) PyGen_Type;
-#define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type)
-#define PyGen_CheckExact(op) Py_IS_TYPE(op, &PyGen_Type)
+#define PyGen_Check(op) PyObject_TypeCheck((op), &PyGen_Type)
+#define PyGen_CheckExact(op) Py_IS_TYPE((op), &PyGen_Type)
PyAPI_FUNC(PyObject *) PyGen_New(PyFrameObject *);
PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(PyFrameObject *,
@@ -46,6 +44,7 @@ PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(PyFrameObject *,
PyAPI_FUNC(int) _PyGen_SetStopIterationValue(PyObject *);
PyAPI_FUNC(int) _PyGen_FetchStopIterationValue(PyObject **);
PyAPI_FUNC(void) _PyGen_Finalize(PyObject *self);
+PyAPI_FUNC(PyCodeObject *) PyGen_GetCode(PyGenObject *gen);
/* --- PyCoroObject ------------------------------------------------------- */
@@ -57,7 +56,7 @@ typedef struct {
PyAPI_DATA(PyTypeObject) PyCoro_Type;
PyAPI_DATA(PyTypeObject) _PyCoroWrapper_Type;
-#define PyCoro_CheckExact(op) Py_IS_TYPE(op, &PyCoro_Type)
+#define PyCoro_CheckExact(op) Py_IS_TYPE((op), &PyCoro_Type)
PyAPI_FUNC(PyObject *) PyCoro_New(PyFrameObject *,
PyObject *name, PyObject *qualname);
@@ -76,7 +75,9 @@ PyAPI_DATA(PyTypeObject) _PyAsyncGenAThrow_Type;
PyAPI_FUNC(PyObject *) PyAsyncGen_New(PyFrameObject *,
PyObject *name, PyObject *qualname);
-#define PyAsyncGen_CheckExact(op) Py_IS_TYPE(op, &PyAsyncGen_Type)
+#define PyAsyncGen_CheckExact(op) Py_IS_TYPE((op), &PyAsyncGen_Type)
+
+#define PyAsyncGenASend_CheckExact(op) Py_IS_TYPE((op), &_PyAsyncGenASend_Type)
#undef _PyGenObject_HEAD