picop.cybuffer#
Buffer protocol helpers.
- picop.cybuffer.buf_check(obj)#
Return True if
objsupports the buffer protocol (PyObject_CheckBuffer).
- picop.cybuffer.buf_copy_data(dest, src)#
Copy buffer data from
srcinto writabledestviaPyObject_CopyData.Notes
Returns
0on success and-1on error; errors raise. Do not use the status int as a bool.
- picop.cybuffer.buf_eq(a, b)#
Return True if buffer-protocol views are equal.
Notes
Mixed Tier A parity: 0.78x (bytes↔ba), 0.78x (mv↔mv), 1.06x (ne); buffer- protocol comparison.
C-contiguous buffers use
memcmp; otherwise memoryview richcompare. Format/size mismatch yieldsFalse.
- picop.cybuffer.buf_itemsize(obj)#
Return the item size of
obj’s exported buffer.
- picop.cybuffer.buf_nbytes(obj)#
Return the total byte length of
obj’s exported buffer.
- picop.cybuffer.buf_ndim(obj)#
Return the dimensionality of
obj’s exported buffer.