Help Topics for to_list

builtin ยท to_list

Sample CLI

gway to-list

Signature

(obj, flat=False)

Docstring

Convert, and optionally flatten, any object into a list with a set of intuitive rules. - If `obj` is a string with spaces, commas, colons, or semicolons, split it. - If `obj` is a dict or a view (e.g., bottle view dict), return ["key=value", ...]. - If `obj` is a list or tuple, return it as a list. - If `obj` is an iterable, convert to list. - Otherwise, return [obj].