File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ Buffer Objects
1010
1111
1212.. index ::
13- object: buffer
1413 single: buffer interface
1514
1615Python objects implemented in C can export a "buffer interface." These
@@ -297,14 +296,25 @@ Buffer related functions
297296 length. Return 0 on success and -1 (with raising an error) on error.
298297
299298
299+ .. index ::
300+ object: memoryview
301+
302+
300303MemoryView objects
301304==================
302305
303- A memoryview object is an extended buffer object that could replace the buffer
304- object (but doesn't have to as that could be kept as a simple 1-d memoryview
305- object). It, unlike :ctype: `Py_buffer `, is a Python object (exposed as
306- :class: `memoryview ` in :mod: `builtins `), so it can be used with Python code.
306+ A memoryview object exposes the C level buffer interface to Python.
307+
307308
308309.. cfunction :: PyObject* PyMemoryView_FromObject(PyObject *obj)
309310
310311 Return a memoryview object from an object that defines the buffer interface.
312+
313+
314+ .. cfunction :: PyObject * PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char order)
315+
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
318+ interface. If memory is contiguous, the memoryview object points to the
319+ original memory. Otherwise copy is made and the memoryview points to a
320+ new bytes object.
You can’t perform that action at this time.
0 commit comments