picop.cybytearray#
Fast bytearray accessors.
- picop.cybytearray.bytearray_check(p)#
Return True if
pis abytearrayor subtype (PyByteArray_Check).
- picop.cybytearray.bytearray_check_exact(p)#
Return True if
type(p) is bytearray(PyByteArray_CheckExact).
- picop.cybytearray.bytearray_concat(a, b)#
Return a new bytearray concatenating
aandbviaPyByteArray_Concat.
- picop.cybytearray.bytearray_contains(haystack, needle)#
Return True if
needleis found in typedhaystack.Notes
Mirrors
bytes_containssearch strategy on a typedbytearray.
- picop.cybytearray.bytearray_eq(a, b)#
Return True if typed
bytearrayvalues are equal.Notes
Identity/len short-circuit plus
memcmp.
- picop.cybytearray.bytearray_from_object(o)#
Return
bytearray(o)viaPyByteArray_FromObject(buffer protocol).
- picop.cybytearray.bytearray_len(ba)#
Return
len(ba)viaPyByteArray_GET_SIZE.
- picop.cybytearray.bytearray_ne(a, b)#
Return True if typed
bytearrayvalues differ (not bytearray_eq).
- picop.cybytearray.bytearray_resize(ba, n)#
Resize
bain place viaPyByteArray_Resize.Notes
Returns
0on success and-1on error; errors raise. Do not use the status int as a bool.