This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ash
Recipients ash, benjamin.peterson, georg.brandl, pitrou
Date 2009-08-07.08:03:40
SpamBayes Score 1.2310458e-10
Marked as misclassified No
Message-id <1249632222.9.0.932073191821.issue6659@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-08-07 08:03:43ashsetrecipients: + ash, georg.brandl, pitrou, benjamin.peterson
2009-08-07 08:03:42ashsetmessageid: <1249632222.9.0.932073191821.issue6659@psf.upfronthosting.co.za>
2009-08-07 08:03:41ashlinkissue6659 messages
2009-08-07 08:03:40ashcreate