def flatten(x):
    """Build a flat list out of any iter-able at infinite depth"""
    result = []
    for el in x:
        # Iteratively call itself until a non-iterable is found
        if hasattr(el, "__len__") and not isinstance(el, str):
            flt = flatten(el)
            result.extend(flt)
        else:
            result.append(el)
    return result