Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency in success/failure return values #25

Open
iritkatriel opened this issue May 13, 2023 · 2 comments
Open

Inconsistency in success/failure return values #25

iritkatriel opened this issue May 13, 2023 · 2 comments
Labels
evolution-proposed theme: consistency theme: implementation flaws problems with the implementation of specific APIs

Comments

@iritkatriel
Copy link
Member

Some API functions (like PyArg_ParseTuple) return 0 for success and non-zero for failure. It is mentioned in the docs that this is possible:

In general, when a function encounters an error, it sets an exception, discards any object references that it owns, and returns an error indicator. If not documented otherwise, this indicator is either NULL or -1, depending on the function’s return type. A few functions return a Boolean true/false result, with false indicating an error.

Nevertheless, it would be better if all the success/failure cases followed the 0/-1 convention.

@iritkatriel iritkatriel added theme: implementation flaws problems with the implementation of specific APIs theme: consistency labels May 14, 2023
@erlend-aasland
Copy link

See python/devguide#1123

@iritkatriel iritkatriel added the v label Jul 21, 2023
@iritkatriel iritkatriel removed the v label Oct 23, 2023
@encukou
Copy link
Contributor

encukou commented Oct 23, 2023

Issue for proposed guidelines: capi-workgroup/api-evolution#13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
evolution-proposed theme: consistency theme: implementation flaws problems with the implementation of specific APIs
Projects
None yet
Development

No branches or pull requests

3 participants