def flatten(iterable):
    """Recursively denest iterable containers.

       >>> flatten([1, 2, 3])
       [1, 2, 3]
       >>> flatten([1, 2, [3]])
       [1, 2, 3]
       >>> flatten([1, [2, 3], [4, 5]])
       [1, 2, 3, 4, 5]
    """
    result = []

    for item in iterable:
        if isinstance(item, list):
            result.extend(flatten(item))
        else:
            result.append(item)

    return result