Skip to content
Closed
Changes from 5 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.
Other API must return ``0`` on success,
and a negative value if and only if an exception is raised.
``-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