Message416066
> The function should return different values for success and error
It does, and a `void` return type enforces it. Here is the trick:
> An important convention throughout the Python interpreter is the following: when a function fails, it should set an exception condition and return an error value (usually -1 or a NULL pointer).
>
> - https://docs.python.org/3/extending/extending.html#intermezzo-errors-and-exceptions
Previously, a function could return NULL but forget to call `PyErr_*()`. With `void`, however, the function has no other choise but to properly set the error indicator so the Clinic's part will see it and return NULL finishing the convention. |
|
Date |
User |
Action |
Args |
2022-03-26 14:40:00 | arhadthedev | set | recipients:
+ arhadthedev, larry, serhiy.storchaka |
2022-03-26 14:40:00 | arhadthedev | set | messageid: <1648305600.8.0.832247772614.issue47128@roundup.psfhosted.org> |
2022-03-26 14:40:00 | arhadthedev | link | issue47128 messages |
2022-03-26 14:40:00 | arhadthedev | create | |
|