Skip to content
Closed
Changes from 3 commits
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
8 changes: 5 additions & 3 deletions developer-workflow/c-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ Guidelines for expanding/changing the public API
fields, arguments and return values are well defined.

- Functions returning ``PyObject *`` must return a valid pointer on success,
and ``NULL`` with an exception raised on error.
Most other API must return ``-1`` with an exception raised on error,
and ``0`` on success.
and ``NULL`` if and only if an exception is raised.
Most other API must return ``0`` on success,
Comment thread
erlend-aasland marked this conversation as resolved.
Outdated
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.
Comment thread
erlend-aasland marked this conversation as resolved.
Outdated

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