picop.cyslice#

Fast slice helpers.

picop.cyslice.slice_check(p)#

Return True if p is a slice (PySlice_Check). :type p: object :param p:

Return type:

bool

Parameters:

p (object)

picop.cyslice.slice_eq(a, b)#

Return True if slices are equal.

Notes

Identity short-circuit plus richcompare.

Parameters:
Return type:

bool

picop.cyslice.slice_indices_ex(sl, length)#

Return (start, stop, step, slicelen) via PySlice_GetIndicesEx.

Notes

Clips like normal Python slices against length.

Parameters:
Return type:

tuple[int, int, int, int]

picop.cyslice.slice_new(start=None, stop=None, step=None)#

Return slice(start, stop, step) via PySlice_New. :type start: object, default: None :param start: :type stop: object, default: None :param stop: :type step: object, default: None :param step:

Return type:

slice

Parameters:
picop.cyslice.slice_unpack(sl)#

Return (start, stop, step) as C integers via PySlice_Unpack. :type sl: object :param sl:

Return type:

tuple[int, int, int]