picop.cylist#
Fast list accessors.
- picop.cylist.list_append(l, value)#
Append
valueviaPyList_Append.Notes
Returns
0on success and-1on error; errors raise. Do not use the status int as a bool.
- picop.cylist.list_as_tuple(l)#
Return
tuple(l)viaPyList_AsTuple. :type l:list:param l:- Return type:
- picop.cylist.list_check(p)#
Return True if
pis alistor subtype (PyList_Check). :type p:object:param p:
- picop.cylist.list_check_exact(p)#
Return True if
type(p) is list(PyList_CheckExact). :type p:object:param p:
- picop.cylist.list_clear(l)#
Clear
lviaPyList_Clear.Notes
Returns
0on success and-1on error; errors raise. Do not use the status int as a bool.
- picop.cylist.list_copy(l)#
Return a shallow copy of
lviaPyList_GetSlice. :type l:list:param l:- Return type:
- picop.cylist.list_eq(a, b)#
Return True if typed lists are equal (identity/len short-circuit + richcompare). :type a:
list:param a: :type b:list:param b:
- picop.cylist.list_extend(l, iterable)#
Extend
lfromiterableviaPyList_Extend.Notes
Returns
0on success and-1on error; errors raise. Do not use the status int as a bool.
- picop.cylist.list_get(l, i)#
Return
l[i]viaPyList_GET_ITEM.Notes
Unchecked: out-of-bounds is undefined behavior. Prefer
list_get_checked/list_get_refwhen the index may be OOB, or bound the index yourself before calling.
- picop.cylist.list_get_checked(l, i)#
Return
l[i]via bounds-checkedPyList_GetItem.Notes
Raises
IndexErroron out-of-bounds (unlike uncheckedlist_get).
- picop.cylist.list_get_ref(l, i)#
Return a strong ref to
l[i]viaPyList_GetItemRef.Notes
Raises
IndexErroron out-of-bounds (unlike uncheckedlist_get).
- picop.cylist.list_insert(l, i, value)#
Insert
valueativiaPyList_Insert.Notes
Returns
0on success and-1on error; errors raise. Do not use the status int as a bool.
- picop.cylist.list_reverse(l)#
Reverse
lin place viaPyList_Reverse.Notes
Returns
0on success and-1on error; errors raise. Do not use the status int as a bool.
- picop.cylist.list_set_item(l, i, value)#
Set
l[i] = valueviaPyList_SetItem.Notes
INCREFs
valuethen steals the new reference into the list slot. Returns0on success and-1on error; errors raise. Do not use the status int as a bool.
- picop.cylist.list_set_slice(l, low, high, itemlist=None)#
Assign
l[low:high] = itemlistviaPyList_SetSlice.Notes
Pass
Noneforitemlistto delete the slice. Returns0on success and-1on error; errors raise. Do not use the status int as a bool.
- picop.cylist.list_size(l)#
Return
len(l)via checkedPyList_Size.Notes
Prefer
list_lenon a typedlisthot path.