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 serhiy.storchaka
Recipients Mark.Shannon, lukasz.langa, scoder, serhiy.storchaka, v2m, yselivanov
Date 2020-09-16.17:01:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600275700.29.0.489772479907.issue41756@roundup.psfhosted.org>
In-reply-to
Content
As for returned value, I propose to return -1 in case of error, 1 for yielded value and 0 for returned value (i.e. define PYGEN_RETURN = 0, PYGEN_YIELD = 1 and PYGEN_ERROR = -1, but without exposing public names).

It would be uniform with other C API: many functions return -1 on error (if they return int and can fail), and PyDict_Next() and _PySet_NextEntry() return 1 for every yielded item, and 0 if the iteration has been finished.
History
Date User Action Args
2020-09-16 17:01:40serhiy.storchakasetrecipients: + serhiy.storchaka, scoder, lukasz.langa, Mark.Shannon, yselivanov, v2m
2020-09-16 17:01:40serhiy.storchakasetmessageid: <1600275700.29.0.489772479907.issue41756@roundup.psfhosted.org>
2020-09-16 17:01:40serhiy.storchakalinkissue41756 messages
2020-09-16 17:01:40serhiy.storchakacreate