Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
Closed
Description
According to the documentation (https://docs.python.org/3/c-api/float.html#c.PyFloat_Pack2), the signature ofPyFloat_Pack{2,4,8}
is
int PyFloat_Pack2(double x, unsigned char *p, int le)
Note that the second parameter is of typeunsigned char *
However, for the implementation, the type is actuallychar *
cpython/Include/cpython/floatobject.h
Line 21 indb20324
PyAPI_FUNC(int)PyFloat_Pack2(doublex,char*p,intle); |
The commit message of882d809, 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 usechar *
as well.
Linked PRs
Metadata
Metadata
Assignees
Projects
Status
Todo