Message376737
@Mark
> Mark Shannon wrote: I don't think [the C-API function] should be public, as a possible further improvement is to stop passing exceptions through a side channel, but in result. Maybe we don't want to do that, but lets' not add to the (already rather large) C-API.
Yeah, we can add it as a "private" function, I'm not entirely opposed to that. But... it would be great if Cython and C code could still depend on it and use it. And then... why should it be private? The corresponding Python API "gen.send()" and "gen.throw()" is public, why can't the C API be public too?
We will not fundamentally change generators (it would be a major backwards incompatible change), so committing to a good C API sounds reasonable.
@Mark
> Remember that PyIter_Next() is pretty much the same, though, and it has the standard "return PyObject*" interface. These two would diverge then.
Maybe we should call it `_PyIter_Send()`? While `.send()` is mostly about coroutines, regular generators have the method too, and it would be weird to call `_PyCoro_Send` on a generator object.
@Vladimir
> PYGEN_ERROR | NULL | Regular PyErr_* functions should be used to work with error case
Correct. |
|
Date |
User |
Action |
Args |
2020-09-11 18:31:13 | yselivanov | set | recipients:
+ yselivanov, scoder, vstinner, lukasz.langa, Mark.Shannon, serhiy.storchaka, v2m |
2020-09-11 18:31:13 | yselivanov | set | messageid: <1599849073.05.0.562657019044.issue41756@roundup.psfhosted.org> |
2020-09-11 18:31:13 | yselivanov | link | issue41756 messages |
2020-09-11 18:31:12 | yselivanov | create | |
|