(structure)
return l
Returns a copy of an iterable object (also copying all embedded iterables).
Returns a copy of an iterable object (also copying all embedded iterables).
Returns a copy of an iterable object ( also copying all embedded iterables ) .
def iter_copy(structure):
    """
    Returns a copy of an iterable object (also copying all embedded iterables).
    """
    l = []
    for i in structure:
        if hasattr(i, "__iter__"):
            l.append(iter_copy(i))
        else:
            l.append(i)
    return l
def iter_copy ( structure ) : l = [ ] for i in structure : if hasattr ( i , "__iter__" ) : l . append ( iter_copy ( i ) ) else : l . append ( i ) return l