Skip to main content

flatten

Return a list which is a single level of flattening of the original list.

def flatten(
fields: Iterable
) - > list

Return a list which is a single level of flattening of the original list.

Parameters

NameTypeDescription
fieldsIterableA collection of items or nested sequences (lists/tuples) to be flattened by one level

Returns

TypeDescription
listA new list containing the elements of the input, where any immediate sub-lists or tuples have been unpacked into the top-level sequence