#define _PY_INTERPRETER
#include "Python.h"
#include "pycore_call.h"
#include "pycore_ceval.h"
#include "pycore_frame.h"
#include "pycore_freelist.h"
#include "pycore_gc.h"
#include "pycore_modsupport.h"
#include "pycore_object.h"
#include "pycore_opcode_utils.h"
#include "pycore_pyatomic_ft_wrappers.h"
#include "pycore_pyerrors.h"
#include "pycore_pystate.h"
#include "pystats.h"
static PyObject* gen_close(PyObject *, PyObject *);
static PyObject* async_gen_asend_new(PyAsyncGenObject *, PyObject *);
static PyObject* async_gen_athrow_new(PyAsyncGenObject *, PyObject *);
#define _PyGen_CAST(op) …
#define _PyCoroObject_CAST(op) …
#define _PyAsyncGenObject_CAST(op) …
static const char *NON_INIT_CORO_MSG = …;
static const char *ASYNC_GEN_IGNORED_EXIT_MSG = …;
static inline PyCodeObject *
_PyGen_GetCode(PyGenObject *gen) { … }
PyCodeObject *
PyGen_GetCode(PyGenObject *gen) { … }
static int
gen_traverse(PyObject *self, visitproc visit, void *arg)
{ … }
void
_PyGen_Finalize(PyObject *self)
{ … }
static void
gen_dealloc(PyObject *self)
{ … }
static PySendResult
gen_send_ex2(PyGenObject *gen, PyObject *arg, PyObject **presult,
int exc, int closing)
{ … }
static PySendResult
PyGen_am_send(PyObject *self, PyObject *arg, PyObject **result)
{ … }
static PyObject *
gen_send_ex(PyGenObject *gen, PyObject *arg, int exc, int closing)
{ … }
PyDoc_STRVAR(send_doc,
"send(arg) -> send 'arg' into generator,\n\
return next yielded value or raise StopIteration.");
static PyObject *
gen_send(PyObject *gen, PyObject *arg)
{ … }
PyDoc_STRVAR(close_doc,
"close() -> raise GeneratorExit inside generator.");
static int
gen_close_iter(PyObject *yf)
{ … }
static inline bool
is_resume(_Py_CODEUNIT *instr)
{ … }
PyObject *
_PyGen_yf(PyGenObject *gen)
{ … }
static PyObject *
gen_close(PyObject *self, PyObject *args)
{ … }
PyDoc_STRVAR(throw_doc,
"throw(value)\n\
throw(type[,value[,tb]])\n\
\n\
Raise exception in generator, return next yielded value or raise\n\
StopIteration.\n\
the (type, val, tb) signature is deprecated, \n\
and may be removed in a future version of Python.");
static PyObject *
_gen_throw(PyGenObject *gen, int close_on_genexit,
PyObject *typ, PyObject *val, PyObject *tb)
{ … }
static PyObject *
gen_throw(PyGenObject *gen, PyObject *const *args, Py_ssize_t nargs)
{ … }
static PyObject *
gen_iternext(PyObject *self)
{ … }
int
_PyGen_SetStopIterationValue(PyObject *value)
{ … }
int
_PyGen_FetchStopIterationValue(PyObject **pvalue)
{ … }
static PyObject *
gen_repr(PyObject *self)
{ … }
static PyObject *
gen_get_name(PyObject *self, void *Py_UNUSED(ignored))
{ … }
static int
gen_set_name(PyObject *self, PyObject *value, void *Py_UNUSED(ignored))
{ … }
static PyObject *
gen_get_qualname(PyObject *self, void *Py_UNUSED(ignored))
{ … }
static int
gen_set_qualname(PyObject *self, PyObject *value, void *Py_UNUSED(ignored))
{ … }
static PyObject *
gen_getyieldfrom(PyObject *gen, void *Py_UNUSED(ignored))
{ … }
static PyObject *
gen_getrunning(PyObject *self, void *Py_UNUSED(ignored))
{ … }
static PyObject *
gen_getsuspended(PyObject *self, void *Py_UNUSED(ignored))
{ … }
static PyObject *
_gen_getframe(PyGenObject *gen, const char *const name)
{ … }
static PyObject *
gen_getframe(PyObject *self, void *Py_UNUSED(ignored))
{ … }
static PyObject *
_gen_getcode(PyGenObject *gen, const char *const name)
{ … }
static PyObject *
gen_getcode(PyObject *self, void *Py_UNUSED(ignored))
{ … }
static PyGetSetDef gen_getsetlist[] = …;
static PyMemberDef gen_memberlist[] = …;
static PyObject *
gen_sizeof(PyGenObject *gen, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(sizeof__doc__,
"gen.__sizeof__() -> size of gen in memory, in bytes");
static PyMethodDef gen_methods[] = …;
static PyAsyncMethods gen_as_async = …;
PyTypeObject PyGen_Type = …;
static PyObject *
make_gen(PyTypeObject *type, PyFunctionObject *func)
{ … }
static PyObject *
compute_cr_origin(int origin_depth, _PyInterpreterFrame *current_frame);
PyObject *
_Py_MakeCoro(PyFunctionObject *func)
{ … }
static PyObject *
gen_new_with_qualname(PyTypeObject *type, PyFrameObject *f,
PyObject *name, PyObject *qualname)
{ … }
PyObject *
PyGen_NewWithQualName(PyFrameObject *f, PyObject *name, PyObject *qualname)
{ … }
PyObject *
PyGen_New(PyFrameObject *f)
{ … }
PyCoroWrapper;
#define _PyCoroWrapper_CAST(op) …
static int
gen_is_coroutine(PyObject *o)
{ … }
PyObject *
_PyCoro_GetAwaitableIter(PyObject *o)
{ … }
static PyObject *
coro_repr(PyObject *self)
{ … }
static PyObject *
coro_await(PyObject *coro)
{ … }
static PyObject *
coro_get_cr_await(PyObject *coro, void *Py_UNUSED(ignored))
{ … }
static PyObject *
cr_getsuspended(PyObject *self, void *Py_UNUSED(ignored))
{ … }
static PyObject *
cr_getrunning(PyObject *self, void *Py_UNUSED(ignored))
{ … }
static PyObject *
cr_getframe(PyObject *coro, void *Py_UNUSED(ignored))
{ … }
static PyObject *
cr_getcode(PyObject *coro, void *Py_UNUSED(ignored))
{ … }
static PyGetSetDef coro_getsetlist[] = …;
static PyMemberDef coro_memberlist[] = …;
PyDoc_STRVAR(coro_send_doc,
"send(arg) -> send 'arg' into coroutine,\n\
return next iterated value or raise StopIteration.");
PyDoc_STRVAR(coro_throw_doc,
"throw(value)\n\
throw(type[,value[,traceback]])\n\
\n\
Raise exception in coroutine, return next iterated value or raise\n\
StopIteration.\n\
the (type, val, tb) signature is deprecated, \n\
and may be removed in a future version of Python.");
PyDoc_STRVAR(coro_close_doc,
"close() -> raise GeneratorExit inside coroutine.");
static PyMethodDef coro_methods[] = …;
static PyAsyncMethods coro_as_async = …;
PyTypeObject PyCoro_Type = …;
static void
coro_wrapper_dealloc(PyObject *self)
{ … }
static PyObject *
coro_wrapper_iternext(PyObject *self)
{ … }
static PyObject *
coro_wrapper_send(PyObject *self, PyObject *arg)
{ … }
static PyObject *
coro_wrapper_throw(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
static PyObject *
coro_wrapper_close(PyObject *self, PyObject *args)
{ … }
static int
coro_wrapper_traverse(PyObject *self, visitproc visit, void *arg)
{ … }
static PyMethodDef coro_wrapper_methods[] = …;
PyTypeObject _PyCoroWrapper_Type = …;
static PyObject *
compute_cr_origin(int origin_depth, _PyInterpreterFrame *current_frame)
{ … }
PyObject *
PyCoro_New(PyFrameObject *f, PyObject *name, PyObject *qualname)
{ … }
AwaitableState;
PyAsyncGenASend;
#define _PyAsyncGenASend_CAST(op) …
PyAsyncGenAThrow;
_PyAsyncGenWrappedValue;
#define _PyAsyncGenWrappedValue_CheckExact(o) …
#define _PyAsyncGenWrappedValue_CAST(op) …
static int
async_gen_traverse(PyObject *self, visitproc visit, void *arg)
{ … }
static PyObject *
async_gen_repr(PyObject *self)
{ … }
static int
async_gen_init_hooks(PyAsyncGenObject *o)
{ … }
static PyObject *
async_gen_anext(PyObject *self)
{ … }
static PyObject *
async_gen_asend(PyAsyncGenObject *o, PyObject *arg)
{ … }
static PyObject *
async_gen_aclose(PyAsyncGenObject *o, PyObject *arg)
{ … }
static PyObject *
async_gen_athrow(PyAsyncGenObject *o, PyObject *args)
{ … }
static PyObject *
ag_getframe(PyObject *ag, void *Py_UNUSED(ignored))
{ … }
static PyObject *
ag_getcode(PyObject *gen, void *Py_UNUSED(ignored))
{ … }
static PyObject *
ag_getsuspended(PyObject *self, void *Py_UNUSED(ignored))
{ … }
static PyGetSetDef async_gen_getsetlist[] = …;
static PyMemberDef async_gen_memberlist[] = …;
PyDoc_STRVAR(async_aclose_doc,
"aclose() -> raise GeneratorExit inside generator.");
PyDoc_STRVAR(async_asend_doc,
"asend(v) -> send 'v' in generator.");
PyDoc_STRVAR(async_athrow_doc,
"athrow(value)\n\
athrow(type[,value[,tb]])\n\
\n\
raise exception in generator.\n\
the (type, val, tb) signature is deprecated, \n\
and may be removed in a future version of Python.");
static PyMethodDef async_gen_methods[] = …;
static PyAsyncMethods async_gen_as_async = …;
PyTypeObject PyAsyncGen_Type = …;
PyObject *
PyAsyncGen_New(PyFrameObject *f, PyObject *name, PyObject *qualname)
{ … }
static PyObject *
async_gen_unwrap_value(PyAsyncGenObject *gen, PyObject *result)
{ … }
static void
async_gen_asend_dealloc(PyObject *self)
{ … }
static int
async_gen_asend_traverse(PyObject *self, visitproc visit, void *arg)
{ … }
static PyObject *
async_gen_asend_send(PyObject *self, PyObject *arg)
{ … }
static PyObject *
async_gen_asend_iternext(PyObject *ags)
{ … }
static PyObject *
async_gen_asend_throw(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
static PyObject *
async_gen_asend_close(PyObject *self, PyObject *args)
{ … }
static void
async_gen_asend_finalize(PyObject *self)
{ … }
static PyMethodDef async_gen_asend_methods[] = …;
static PyAsyncMethods async_gen_asend_as_async = …;
PyTypeObject _PyAsyncGenASend_Type = …;
static PyObject *
async_gen_asend_new(PyAsyncGenObject *gen, PyObject *sendval)
{ … }
static void
async_gen_wrapped_val_dealloc(PyObject *self)
{ … }
static int
async_gen_wrapped_val_traverse(PyObject *self, visitproc visit, void *arg)
{ … }
PyTypeObject _PyAsyncGenWrappedValue_Type = …;
PyObject *
_PyAsyncGenValueWrapperNew(PyThreadState *tstate, PyObject *val)
{ … }
#define _PyAsyncGenAThrow_CAST(op) …
static void
async_gen_athrow_dealloc(PyObject *self)
{ … }
static int
async_gen_athrow_traverse(PyObject *self, visitproc visit, void *arg)
{ … }
static PyObject *
async_gen_athrow_send(PyObject *self, PyObject *arg)
{ … }
static PyObject *
async_gen_athrow_throw(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
static PyObject *
async_gen_athrow_iternext(PyObject *agt)
{ … }
static PyObject *
async_gen_athrow_close(PyObject *self, PyObject *args)
{ … }
static void
async_gen_athrow_finalize(PyAsyncGenAThrow *o)
{ … }
static PyMethodDef async_gen_athrow_methods[] = …;
static PyAsyncMethods async_gen_athrow_as_async = …;
PyTypeObject _PyAsyncGenAThrow_Type = …;
static PyObject *
async_gen_athrow_new(PyAsyncGenObject *gen, PyObject *args)
{ … }