Message377608
No, I don't think so but I can definitely make one. A few questions first:
- having PySendResult as a result type of PyIterSend seems ok, however prefix for each concrete value (PYGEN_*) is not aligned with the prefix of the function itself (PyIter_)
- should it also deal with tstate->c_tracefunc (probably not) or just be something like
```
PySendResult
PyIter_Send(PyObject *iter, PyObject *arg, PyObject **result)
{
_Py_IDENTIFIER(send);
assert(result != NULL);
if (PyGen_CheckExact(iter) || PyCoro_CheckExact(iter)) {
return PyGen_Send((PyGenObject *)iter, arg, result);
}
if (arg == Py_None && Py_TYPE(iter)->tp_iternext != NULL) {
*result = Py_TYPE(iter)->tp_iternext(iter);
}
else {
*result = _PyObject_CallMethodIdOneArg(iter, &PyId_send, arg);
}
if (*result == NULL) {
if (_PyGen_FetchStopIterationValue(result) == 0) {
return PYGEN_RETURN;
}
return PYGEN_ERROR;
}
return PYGEN_NEXT;
}
``` |
|
Date |
User |
Action |
Args |
2020-09-28 17:38:21 | v2m | set | recipients:
+ v2m, scoder, lukasz.langa, Mark.Shannon, serhiy.storchaka, yselivanov |
2020-09-28 17:38:21 | v2m | set | messageid: <1601314701.25.0.193924013357.issue41756@roundup.psfhosted.org> |
2020-09-28 17:38:21 | v2m | link | issue41756 messages |
2020-09-28 17:38:20 | v2m | create | |
|