New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some C buffer protocol APIs not documented #77307
Comments
The following C functions are available for C code but not documented:
I am not sure how to describe those functions myself. |
I fixed PyBuffer_ToContiguous() in 3.3, PyBuffer_FromContiguous() was broken until bpo-23370. For a start, here's a doc patch for PyBuffer_ToContiguous(). PyBuffer_FromContiguous() does the opposite and loads a contiguous buffer PyObject_CopyData() copies the data from exporter src to the writable exporter dest. I have never used the last two functions. |
Thanks. The PyBuffer_ToContiguous() API is weird: why pass |
Yes, the signatures are weird. In PyBuffer_FromContiguous(), "len" is If "buf" contains 6 floats, but "view" only has space for 4, then only To avoid that sort of thing, I changed PyBuffer_ToContiguous() to In PyBuffer_ToContiguous() it would not matter though if len(buf) > src->len, in which case buf would contain uninitialized bytes at TBH, I don't think these functions are used very often. :-) |
And if view->len > len in PyBuffer_FromContiguous(), then |
Ok, it seems only PyBuffer_ToContiguous() is worth documenting. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: