Skip to content

Signature of PyFloat_Pack{2,4,8} inconsistent with documentation #136663

@ShawnZhong

Description

@ShawnZhong

According to the documentation (https://docs.python.org/3/c-api/float.html#c.PyFloat_Pack2), the signature of PyFloat_Pack{2,4,8} is

int PyFloat_Pack2(double x, unsigned char *p, int le)

Note that the second parameter is of type unsigned char *

However, for the implementation, the type is actually char *

PyAPI_FUNC(int) PyFloat_Pack2(double x, char *p, int le);

The commit message of 882d809, says "Replace the "unsigned char*" type with "char*" which is more common and easy to use". So the fix is to update the docs to use char * as well.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions