Skip to content

Inconsistency in success/failure return values #25

Open
@iritkatriel

Description

@iritkatriel

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions