summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/buffer.rst
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-28 23:39:41 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-28 23:39:41 (GMT)
commitf7ba2fa3d663c5755af0932e0d8fe820fb7de8af (patch)
treecc20c969386846e73237f146de64f9cd9372ab81 /Doc/c-api/buffer.rst
parent99a00a455c186873cf23adde0c6c1bab4d14a4c0 (diff)
downloadcpython-f7ba2fa3d663c5755af0932e0d8fe820fb7de8af.zip
cpython-f7ba2fa3d663c5755af0932e0d8fe820fb7de8af.tar.gz
cpython-f7ba2fa3d663c5755af0932e0d8fe820fb7de8af.tar.bz2
Buffers are not sequence objects (!). Put them in the abstract objects layers
instead.
Diffstat (limited to 'Doc/c-api/buffer.rst')
-rw-r--r--Doc/c-api/buffer.rst27
1 files changed, 14 insertions, 13 deletions
diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst
index 8b64e6c..dbd1e4d 100644
--- a/Doc/c-api/buffer.rst
+++ b/Doc/c-api/buffer.rst
@@ -2,8 +2,8 @@
.. _bufferobjects:
-Buffer API
-----------
+Buffer Protocol
+---------------
.. sectionauthor:: Greg Stein <gstein@lyra.org>
.. sectionauthor:: Benjamin Peterson
@@ -50,21 +50,22 @@ How the buffer interface is exposed by a type object is described in the
section :ref:`buffer-structs`, under the description for :ctype:`PyBufferProcs`.
-Buffer objects
-==============
+The buffer structure
+====================
-Buffer objects are useful as a way to expose the binary data from another
-object to the Python programmer. They can also be used as a zero-copy
-slicing mechanism. Using their ability to reference a block of memory, it is
-possible to expose any data to the Python programmer quite easily. The memory
-could be a large, constant array in a C extension, it could be a raw block of
-memory for manipulation before passing to an operating system library, or it
-could be used to pass around structured data in its native, in-memory format.
+Buffer structures (or simply "buffers") are useful as a way to expose the
+binary data from another object to the Python programmer. They can also be
+used as a zero-copy slicing mechanism. Using their ability to reference a
+block of memory, it is possible to expose any data to the Python programmer
+quite easily. The memory could be a large, constant array in a C extension,
+it could be a raw block of memory for manipulation before passing to an
+operating system library, or it could be used to pass around structured data
+in its native, in-memory format.
-Contrary to most data types exposed by the Python interpreter, buffer objects
+Contrary to most data types exposed by the Python interpreter, buffers
are not :ctype:`PyObject` pointers but rather simple C structures. This
allows them to be created and copied very simply. When a generic wrapper
-around a buffer object is needed, a :ref:`memoryview <memoryviewobjects>` object
+around a buffer is needed, a :ref:`memoryview <memoryviewobjects>` object
can be created.