Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added am_send for generators
  • Loading branch information
vladima committed Oct 20, 2020
commit 4635bf147e08a01309296ef9be17c7483e88d687
10 changes: 9 additions & 1 deletion Objects/genobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,14 @@ static PyMethodDef gen_methods[] = {
{NULL, NULL} /* Sentinel */
};

static PyAsyncMethods gen_as_async = {
0, /* am_await */
0, /* am_aiter */
0, /* am_anext */
(sendfunc)PyGen_am_send, /* am_send */
};


PyTypeObject PyGen_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"generator", /* tp_name */
Expand All @@ -778,7 +786,7 @@ PyTypeObject PyGen_Type = {
0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_as_async */
&gen_as_async, /* tp_as_async */
(reprfunc)gen_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
Expand Down