@@ -303,18 +303,40 @@ Buffer related functions
303303MemoryView objects
304304==================
305305
306- A memoryview object exposes the C level buffer interface to Python.
306+ A :class: `memoryview ` object exposes the C level buffer interface as a
307+ Python object which can then be passed around like any other object.
307308
308309
309- .. cfunction :: PyObject* PyMemoryView_FromObject(PyObject *obj)
310+ .. cfunction :: PyObject * PyMemoryView_FromObject(PyObject *obj)
310311
311- Return a memoryview object from an object that defines the buffer interface.
312+ Create a memoryview object from an object that defines the buffer interface.
312313
313314
314- .. cfunction :: PyObject * PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char order )
315+ .. cfunction :: PyObject *PyMemoryView_FromBuffer(Py_buffer *view )
315316
316- Return a memoryview object to a contiguous chunk of memory (in either
317- 'C' or 'F'ortran order) from an object that defines the buffer
317+ Create a memoryview object wrapping the given buffer-info structure *view *.
318+ The memoryview object then owns the buffer, which means you shouldn't
319+ try to release it yourself: it will be released on deallocation of the
320+ memoryview object.
321+
322+
323+ .. cfunction :: PyObject *PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char order)
324+
325+ Create a memoryview object to a contiguous chunk of memory (in either
326+ 'C' or 'F'ortran *order *) from an object that defines the buffer
318327 interface. If memory is contiguous, the memoryview object points to the
319328 original memory. Otherwise copy is made and the memoryview points to a
320329 new bytes object.
330+
331+
332+ .. cfunction :: int PyMemoryView_Check(PyObject *obj)
333+
334+ Return true if the object *obj * is a memoryview object. It is not
335+ currently allowed to create subclasses of :class: `memoryview `.
336+
337+
338+ .. cfunction :: Py_buffer *PyMemoryView_GET_BUFFER(PyObject *obj)
339+
340+ Return a pointer to the buffer-info structure wrapped by the given
341+ object. The object **must ** be a memoryview instance; this macro doesn't
342+ check its type, you must do it yourself or you will risk crashes.
0 commit comments