flatlist/__init__.py
def flatten_list(input_list):
    """
    Flattens list with many nested lists.

    >>> flatten_list([1, [2, [3], [4]]])
    [1, 2, 3, 4]
    """
    result = []
    for item in input_list:
        if isinstance(item, list):
            result.extend(flatten_list(item))
            # yield from flatten_list(item)
        else:
            result.append(item)
            # yield item

    return result

    Flattens list with many nested lists.

    >>> flatten_list([1, [2, [3], [4]]])
    [1, 2, 3, 4]
    
Flattens list with many nested lists.
Flattens list with many nested lists .
def flatten_list(input_list):
    result = []
    for item in input_list:
        if isinstance(item, list):
            result.extend(flatten_list(item))
        else:
            result.append(item)
    return result
def flatten_list ( input_list ) : result = [ ] for item in input_list : if isinstance ( item , list ) : result . extend ( flatten_list ( item ) ) else : result . append ( item ) return result
Flattens list with many nested lists.
Flattens list with many nested lists .
"""
    Flattens list with many nested lists.

    >>> flatten_list([1, [2, [3], [4]]])
    [1, 2, 3, 4]
    """ # yield from flatten_list(item) # yield item
input_list