arte/utils/iterators.py
def flatten(x):
    '''
    Generator that flatten arbitrarily nested lists.

    This generator will flatten a list that may contain
    other lists (nested arbitrarily) and simple items
    into a flat list.

    >>> flat = flatten([[1,[2,3]],4,[5,6]])
    >>> list(flat)
    [1, 2, 3, 4, 5, 6]
    '''
    for item in x:
        try:
            yield from flatten(item)
        except TypeError:
            yield item

    Generator that flatten arbitrarily nested lists.

    This generator will flatten a list that may contain
    other lists (nested arbitrarily) and simple items
    into a flat list.

    >>> flat = flatten([[1,[2,3]],4,[5,6]])
    >>> list(flat)
    [1, 2, 3, 4, 5, 6]
    
Generator that flatten arbitrarily nested lists.
This generator will flatten a list that may contain
other lists (nested arbitrarily) and simple items
into a flat list.


Generator that flatten arbitrarily nested lists . This generator will flatten a list that may contain other lists ( nested arbitrarily ) and simple items into a flat list .
def flatten(x):
    for item in x:
        try:
            yield from flatten(item)
        except TypeError:
            yield item
def flatten ( x ) : for item in x : try : yield from flatten ( item ) except TypeError : yield item
Generator that flatten arbitrarily nested lists.
Generator that flatten arbitrarily nested lists .
'''
    Generator that flatten arbitrarily nested lists.

    This generator will flatten a list that may contain
    other lists (nested arbitrarily) and simple items
    into a flat list.

    >>> flat = flatten([[1,[2,3]],4,[5,6]])
    >>> list(flat)
    [1, 2, 3, 4, 5, 6]
    '''
x