Author ash
Recipients ash, benjamin.peterson, georg.brandl, pitrou
Date 2009-08-07.08:03:40
SpamBayes Score 1.23105e-10
Marked as misclassified No
Message-id <>
Antoine, it seems, this sentence was taken literally from PEP3118
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). 


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

.. 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.
Date User Action Args
2009-08-07 08:03:43ashsetrecipients: + ash, georg.brandl, pitrou, benjamin.peterson
2009-08-07 08:03:42ashsetmessageid: <>
2009-08-07 08:03:41ashlinkissue6659 messages
2009-08-07 08:03:40ashcreate