Skip to main content

slice_filter

Return a slice of the list using the same syntax as Python's list slicing.

def slice_filter(
value: Any,
arg: string
) - > Any

Return a slice of the list using the same syntax as Python's list slicing.

Parameters

NameTypeDescription
valueAnyThe sequence or list-like object to be sliced.
argstringA string representing the slice indices in Python's 'start:stop:step' format.

Returns

TypeDescription
AnyThe sliced portion of the input value if the argument is valid; otherwise, returns the original value.