Commits

Jean-Paul Calderone committed abe5265

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

  • Participants
  • Parent commits 186a3c9
  • Branches pyarg-parsebuffer-new

Comments (0)

Files changed (1)

File pypy/module/cpyext/object.py

 @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
 
 @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)