Message377007
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;
``` |
|
Date |
User |
Action |
Args |
2020-09-16 18:22:32 | v2m | set | recipients:
+ v2m, scoder, lukasz.langa, Mark.Shannon, serhiy.storchaka, yselivanov |
2020-09-16 18:22:32 | v2m | set | messageid: <1600280552.05.0.740079444249.issue41756@roundup.psfhosted.org> |
2020-09-16 18:22:32 | v2m | link | issue41756 messages |
2020-09-16 18:22:31 | v2m | create | |
|