8000 Improve C API guidelines for return values by erlend-aasland · Pull Request #1129 · python/devguide · GitHub
[go: up one dir, main page]

Skip to content

Improve C API 8000 guidelines for return values #1129

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

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update developer-workflow/c-api.rst
  • Loading branch information
erlend-aasland authored Sep 6, 2023
commit 95b59518f8eb8945c824e30e8e5e1a211f48bbd5
4 changes: 2 additions & 2 deletions developer-workflow/c-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ Guidelines for expanding/changing the public API
and ``NULL`` if and only if an exception is raised.
Other API must return ``0`` on success,
and a negative value if and only if an exception is raised.
Unless there is need to distinguish between error types,
``-1`` should be used as the error value.
``-1`` should be used as the error value;
the caller should use the C idiom ``if (func() < 0)`` to check for errors.

- APIs with lesser and greater results must return ``0`` for the lesser result,
and ``1`` for the greater result.
Expand Down
0