def all_segmentations(l):
    """Get all segmentations of a list ``l``.

    This gets bigger fast. See https://oeis.org/A000110
    For len(l) = 14 it is 190,899,322

    >>> list(all_segmentations([0, 1, 2]))
    [[[0, 1, 2]], [[0, 1], [2]], [[1], [0, 2]], [[0], [1, 2]], [[0], [1], [2]]]

    """
    for K in range(1, len(l)+1):
        gen = neclusters(l, K)
        for el in gen:
            yield el
def all_segmentations ( l ) : for K in range ( 1 , len ( l ) + 1 ) : gen = neclusters ( l , K ) for el in gen : yield el
Get all segmentations of a list ``l``.

    This gets bigger fast. See https://oeis.org/A000110
    For len(l) = 14 it is 190,899,322

    >>> list(all_segmentations([0, 1, 2]))
    [[[0, 1, 2]], [[0, 1], [2]], [[1], [0, 2]], [[0], [1, 2]], [[0], [1], [2]]]