-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Check documentation of PyObject_CopyData #102383
Comments
I few lines below, abstract.c has
So the 'PyObjects' indeed have to be buffer-like. I don't know the technical details, but I suspect that there is no real bug. |
There is a bug as the documentation does not match the implementation, |
Yes, int
PyObject_CheckBuffer(PyObject *obj)
{
PyBufferProcs *tp_as_buffer = Py_TYPE(obj)->tp_as_buffer;
return (tp_as_buffer != NULL && tp_as_buffer->bf_getbuffer != NULL);
} So, there's clearly a bug in the docs. PR is sent :) |
…t *` (pythonGH-102390) (cherry picked from commit 7b91320) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* main: pythongh-102021 : Allow multiple input files for interpreter loop generator (python#102022) Add import of `unittest.mock.Mock` in documentation (python#102346) pythongh-102383: [docs] Arguments of `PyObject_CopyData` are `PyObject *` (python#102390) pythongh-101754: Document that Windows converts keys in `os.environ` to uppercase (pythonGH-101840) pythongh-102324: Improve tests of `typing.override` (python#102325)
According to the documentation,
PyObject_CopyData
takes two arguments of typePy_buffer*
:cpython/Doc/c-api/buffer.rst
Line 502 in 71db5db
But in the implementation, it actually takes two arguments of
PyObject*
:cpython/Objects/abstract.c
Line 613 in 71db5db
Linked PRs
PyObject_CopyData
arePyObject *
#102390PyObject_CopyData
arePyObject *
(GH-102390) #102401The text was updated successfully, but these errors were encountered: