Alexey Shamrin <sham...@gmail.com> added the comment: Antoine, it seems, this sentence was taken literally from PEP3118 (http://www.python.org/dev/peps/pep-3118/#new-c-api-calls-are-proposed). PEP authors discussed if __builtins__.buffer should be removed.
I agree, old __builtins__.buffer should not be mentioned here at all. I think, the best way to fix is to describe what is memoryview at the C-level and properly document its C API. For example, PyMemoryView_GetContiguous is not documented here at all (some documentation is in header file - see memoryobject.h). I suggest rewriting the whole section (see below). Notes: 1. I haven't documented #define's from memoryview.h - do we need to? 2. I have renamed 'fort' to 'order'. It sounds much better now I think... Can we also change memoryview.h to use 'order'? I also want to rename 'obj' to 'buffer'. What do you think? It will simplify description of these functions... 3. I haven't documented 'buffertype'. Feel free to do so ;-) There's some text in PEP3118, in memoryview.h and memoryview.c. MemoryView objects ================== PyMemoryViewObject is a subtype of PyObject representing Python :class:`memoryview` object. .. cfunction:: PyObject* PyMemoryView_FromObject(PyObject *obj) Return a memoryview object from an object that defines the buffer interface. .. cfunction:: PyObject * PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char order) Return a memoryview object to a contiguous chunk of memory (in either 'C' or 'F'ortran order) from an object that defines the buffer interface. If memory is contiguous, the memoryview object points to the original memory. Otherwise copy is made and the memoryview points to a new bytes object. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6659> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com