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 yselivanov
Recipients Mark.Shannon, lukasz.langa, scoder, serhiy.storchaka, v2m, vstinner, yselivanov
Date 2020-09-11.18:31:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> 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.

> 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.

> PYGEN_ERROR  | NULL     | Regular PyErr_* functions should be used to work with error case

Date User Action Args
2020-09-11 18:31:13yselivanovsetrecipients: + yselivanov, scoder, vstinner, lukasz.langa, Mark.Shannon, serhiy.storchaka, v2m
2020-09-11 18:31:13yselivanovsetmessageid: <>
2020-09-11 18:31:13yselivanovlinkissue41756 messages
2020-09-11 18:31:12yselivanovcreate