#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(PyGenObject *, PyObject *);
static PyObject *async_gen_asend_new(PyAsyncGenObject *, PyObject *);
static PyObject *async_gen_athrow_new(PyAsyncGenObject *, PyObject *);
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(PyGenObject *gen, visitproc visit, void *arg)
{ … }
void
_PyGen_Finalize(PyObject *self)
{ … }
static void
gen_dealloc(PyGenObject *gen)
{ … }
static PySendResult
gen_send_ex2(PyGenObject *gen, PyObject *arg, PyObject **presult,
int exc, int closing)
{ … }
static PySendResult
PyGen_am_send(PyGenObject *gen, 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(PyGenObject *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(PyGenObject *gen, 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(PyGenObject *gen)
{ … }
int
_PyGen_SetStopIterationValue(PyObject *value)
{ … }
int
_PyGen_FetchStopIterationValue(PyObject **pvalue)
{ … }
static PyObject *
gen_repr(PyGenObject *gen)
{ … }
static PyObject *
gen_get_name(PyGenObject *op, void *Py_UNUSED(ignored))
{ … }
static int
gen_set_name(PyGenObject *op, PyObject *value, void *Py_UNUSED(ignored))
{ … }
static PyObject *
gen_get_qualname(PyGenObject *op, void *Py_UNUSED(ignored))
{ … }
static int
gen_set_qualname(PyGenObject *op, PyObject *value, void *Py_UNUSED(ignored))
{ … }
static PyObject *
gen_getyieldfrom(PyGenObject *gen, void *Py_UNUSED(ignored))
{ … }
static PyObject *
gen_getrunning(PyGenObject *gen, void *Py_UNUSED(ignored))
{ … }
static PyObject *
gen_getsuspended(PyGenObject *gen, void *Py_UNUSED(ignored))
{ … }
static PyObject *
_gen_getframe(PyGenObject *gen, const char *const name)
{ … }
static PyObject *
gen_getframe(PyGenObject *gen, void *Py_UNUSED(ignored))
{ … }
static PyObject *
_gen_getcode(PyGenObject *gen, const char *const name)
{ … }
static PyObject *
gen_getcode(PyGenObject *gen, 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;
static int
gen_is_coroutine(PyObject *o)
{ … }
PyObject *
_PyCoro_GetAwaitableIter(PyObject *o)
{ … }
static PyObject *
coro_repr(PyCoroObject *coro)
{ … }
static PyObject *
coro_await(PyCoroObject *coro)
{ … }
static PyObject *
coro_get_cr_await(PyCoroObject *coro, void *Py_UNUSED(ignored))
{ … }
static PyObject *
cr_getsuspended(PyCoroObject *coro, void *Py_UNUSED(ignored))
{ … }
static PyObject *
cr_getrunning(PyCoroObject *coro, void *Py_UNUSED(ignored))
{ … }
static PyObject *
cr_getframe(PyCoroObject *coro, void *Py_UNUSED(ignored))
{ … }
static PyObject *
cr_getcode(PyCoroObject *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(PyCoroWrapper *cw)
{ … }
static PyObject *
coro_wrapper_iternext(PyCoroWrapper *cw)
{ … }
static PyObject *
coro_wrapper_send(PyCoroWrapper *cw, PyObject *arg)
{ … }
static PyObject *
coro_wrapper_throw(PyCoroWrapper *cw, PyObject *const *args, Py_ssize_t nargs)
{ … }
static PyObject *
coro_wrapper_close(PyCoroWrapper *cw, PyObject *args)
{ … }
static int
coro_wrapper_traverse(PyCoroWrapper *cw, 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;
PyAsyncGenAThrow;
_PyAsyncGenWrappedValue;
#define _PyAsyncGenWrappedValue_CheckExact(o) …
static int
async_gen_traverse(PyAsyncGenObject *gen, visitproc visit, void *arg)
{ … }
static PyObject *
async_gen_repr(PyAsyncGenObject *o)
{ … }
static int
async_gen_init_hooks(PyAsyncGenObject *o)
{ … }
static PyObject *
async_gen_anext(PyAsyncGenObject *o)
{ … }
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(PyAsyncGenObject *ag, void *Py_UNUSED(ignored))
{ … }
static PyObject *
ag_getcode(PyGenObject *gen, void *Py_UNUSED(ignored))
{ … }
static PyObject *
ag_getsuspended(PyAsyncGenObject *ag, 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(PyAsyncGenASend *o)
{ … }
static int
async_gen_asend_traverse(PyAsyncGenASend *o, visitproc visit, void *arg)
{ … }
static PyObject *
async_gen_asend_send(PyAsyncGenASend *o, PyObject *arg)
{ … }
static PyObject *
async_gen_asend_iternext(PyAsyncGenASend *o)
{ … }
static PyObject *
async_gen_asend_throw(PyAsyncGenASend *o, PyObject *const *args, Py_ssize_t nargs)
{ … }
static PyObject *
async_gen_asend_close(PyAsyncGenASend *o, PyObject *args)
{ … }
static void
async_gen_asend_finalize(PyAsyncGenASend *o)
{ … }
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(_PyAsyncGenWrappedValue *o)
{ … }
static int
async_gen_wrapped_val_traverse(_PyAsyncGenWrappedValue *o,
visitproc visit, void *arg)
{ … }
PyTypeObject _PyAsyncGenWrappedValue_Type = …;
PyObject *
_PyAsyncGenValueWrapperNew(PyThreadState *tstate, PyObject *val)
{ … }
static void
async_gen_athrow_dealloc(PyAsyncGenAThrow *o)
{ … }
static int
async_gen_athrow_traverse(PyAsyncGenAThrow *o, visitproc visit, void *arg)
{ … }
static PyObject *
async_gen_athrow_send(PyAsyncGenAThrow *o, PyObject *arg)
{ … }
static PyObject *
async_gen_athrow_throw(PyAsyncGenAThrow *o, PyObject *const *args, Py_ssize_t nargs)
{ … }
static PyObject *
async_gen_athrow_iternext(PyAsyncGenAThrow *o)
{ … }
static PyObject *
async_gen_athrow_close(PyAsyncGenAThrow *o, 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)
{ … }