Skip to main content

to_list

Put value into a list if it's not already one.

def to_list(
value: any
) - > list

Put value into a list if it's not already one.

Parameters

NameTypeDescription
valueanyThe object or collection to be ensured as a list format

Returns

TypeDescription
listA list containing the original value, or the value itself if it was already a list