mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Fix types in buffer/memoryview docs (GH-98118)
The definition of obj in the `Py_buffer` struct is as a PyObject*ec091bd47e/Include/pybuffer.hGH-L22
PyMemoryView_GET_BASE returns `.obj` - thus its return type should be a PyObject* (or at least a void*). It definitely doesn't return `Py_buffer` (cherry picked from commitc459fedf7c
) Co-authored-by: da-woods <dw-git@d-woods.co.uk>
This commit is contained in:
parent
ccb56804fd
commit
03ea515f33
2 changed files with 2 additions and 2 deletions
|
@ -99,7 +99,7 @@ a buffer, see :c:func:`PyObject_GetBuffer`.
|
|||
For :term:`contiguous` arrays, the value points to the beginning of
|
||||
the memory block.
|
||||
|
||||
.. c:member:: void *obj
|
||||
.. c:member:: PyObject *obj
|
||||
|
||||
A new reference to the exporting object. The reference is owned by
|
||||
the consumer and automatically decremented and set to ``NULL`` by
|
||||
|
|
|
@ -55,7 +55,7 @@ any other object.
|
|||
*mview* **must** be a memoryview instance; this macro doesn't check its type,
|
||||
you must do it yourself or you will risk crashes.
|
||||
|
||||
.. c:function:: Py_buffer *PyMemoryView_GET_BASE(PyObject *mview)
|
||||
.. c:function:: PyObject *PyMemoryView_GET_BASE(PyObject *mview)
|
||||
|
||||
Return either a pointer to the exporting object that the memoryview is based
|
||||
on or ``NULL`` if the memoryview has been created by one of the functions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue