Message377002
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. |
|
Date |
User |
Action |
Args |
2020-09-16 17:01:40 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, scoder, lukasz.langa, Mark.Shannon, yselivanov, v2m |
2020-09-16 17:01:40 | serhiy.storchaka | set | messageid: <1600275700.29.0.489772479907.issue41756@roundup.psfhosted.org> |
2020-09-16 17:01:40 | serhiy.storchaka | link | issue41756 messages |
2020-09-16 17:01:40 | serhiy.storchaka | create | |
|