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 arhadthedev
Recipients arhadthedev, larry, serhiy.storchaka
Date 2022-03-26.14:40:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1648305600.8.0.832247772614.issue47128@roundup.psfhosted.org>
In-reply-to
Content
> 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.
History
Date User Action Args
2022-03-26 14:40:00arhadthedevsetrecipients: + arhadthedev, larry, serhiy.storchaka
2022-03-26 14:40:00arhadthedevsetmessageid: <1648305600.8.0.832247772614.issue47128@roundup.psfhosted.org>
2022-03-26 14:40:00arhadthedevlinkissue47128 messages
2022-03-26 14:40:00arhadthedevcreate