This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author v2m
Recipients Mark.Shannon, lukasz.langa, scoder, serhiy.storchaka, v2m, yselivanov
Date 2020-09-16.18:22:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600280552.05.0.740079444249.issue41756@roundup.psfhosted.org>
In-reply-to
Content
Also should it be specific to generators/coroutines and accept PyGenObject* or should it try to handle multiple cases and expose the result for them in uniform way, i.e.
```
if (PyGen_CheckExact(gen) || PyCoro_CheckExact(gen)) {
   // use coroutine/generator specific code that avoids raising exceptions
   *result = ...
   return PYGEN_RETURN;
}
PyObject *ret;
if (arg == Py_None) {
  ret = Py_TYPE(gen)->tp_iternext(gen);
}
else {
  ret = _PyObject_CallMethodIdOneArg(coro, &PyId_send, arg);
}
if (ret != NULL) {
  *result = ret;
  return PYGEN_YIELD;
}
if (_PyGen_FetchStopIterationValue(result) == 0) {
  return PYGEN_RETURN;
}
return PYGEN_ERROR;
```
History
Date User Action Args
2020-09-16 18:22:32v2msetrecipients: + v2m, scoder, lukasz.langa, Mark.Shannon, serhiy.storchaka, yselivanov
2020-09-16 18:22:32v2msetmessageid: <1600280552.05.0.740079444249.issue41756@roundup.psfhosted.org>
2020-09-16 18:22:32v2mlinkissue41756 messages
2020-09-16 18:22:31v2mcreate