Skip to content

C API docs: an int valued function cannot return "true" #129362

@jwuttke

Description

@jwuttke

Documentation

Here https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_Check, and probably in many other places:

int PyUnicode_Check([PyObject](https://docs.python.org/3/c-api/structures.html#c.PyObject) *obj)

    Return true if the object obj is a Unicode object or an instance of a Unicode subtype. This function always succeeds.

This is not the degree of precision I would expect from an API reference. The return value is int, not bool, therefore true is unprecise.

Correct wording: "Return 1 if ... Otherwise return 0."

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc direasypendingThe issue will be closed if no feedback is providedtopic-C-API

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions