[pypy-svn] pypy pyarg-parsebuffer-new: Copy documentation from CPython; note the incompleteness of this implementation.

exarkun commits-noreply at bitbucket.org
Fri Apr 22 20:05:04 CEST 2011


Author: Jean-Paul Calderone <exarkun at twistedmatrix.com>
Branch: pyarg-parsebuffer-new
Changeset: r43538:abe5265d2444
Date: 2011-04-22 14:03 -0400
http://bitbucket.org/pypy/pypy/changeset/abe5265d2444/

Log:	Copy documentation from CPython; note the incompleteness of this
	implementation.

diff --git a/pypy/module/cpyext/object.py b/pypy/module/cpyext/object.py
--- a/pypy/module/cpyext/object.py
+++ b/pypy/module/cpyext/object.py
@@ -433,6 +433,14 @@
 @cpython_api([lltype.Ptr(Py_buffer), PyObject, rffi.VOIDP, Py_ssize_t,
               lltype.Signed, lltype.Signed], rffi.INT, error=CANNOT_FAIL)
 def PyBuffer_FillInfo(space, view, obj, buf, length, readonly, flags):
+    """
+    Fills in a buffer-info structure correctly for an exporter that can only
+    share a contiguous chunk of memory of "unsigned bytes" of the given
+    length. Returns 0 on success and -1 (with raising an error) on error.
+
+    This is not a complete re-implementation of the CPython API; it only
+    provides a subset of CPython's behavior.
+    """
     view.c_buf = buf
     view.c_len = length
     view.c_obj = obj
@@ -442,4 +450,10 @@
 
 @cpython_api([lltype.Ptr(Py_buffer)], lltype.Void, error=CANNOT_FAIL)
 def PyBuffer_Release(space, view):
+    """
+    Releases a Py_buffer obtained from getbuffer ParseTuple's s*.
+
+    This is not a complete re-implementation of the CPython API; it only
+    provides a subset of CPython's behavior.
+    """
     Py_DecRef(space, view.c_obj)


More information about the Pypy-commit mailing list