[issue41756] Do not always use exceptions to return result from coroutine

Vladimir Matveev report at bugs.python.org
Fri Sep 11 13:19:55 EDT 2020


Vladimir Matveev <desco.by at gmail.com> added the comment:

If I understand proposed shape of API correctly - it was not supposed to return exception via "result" so contract for new `PyGen_Send` function is something like:

Return value | result   | Comment
-----------------------------------------------------
PYGEN_RETURN | not NULL | Returned value
PYGEN_NEXT   | not NULL | Yielded value
PYGEN_ERROR  | NULL     | Regular PyErr_* functions should be used to work with error case

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41756>
_______________________________________


More information about the Python-bugs-list mailing list