sequencetools.yield_all_partitions_of_sequence

abjad.tools.sequencetools.yield_all_partitions_of_sequence.yield_all_partitions_of_sequence(sequence)[source]

New in version 2.0.

Yield all partitions of sequence:

abjad> from abjad.tools import sequencetools
abjad> for partition in sequencetools.yield_all_partitions_of_sequence([0, 1, 2, 3]):
...     partition
...
[[0, 1, 2, 3]]
[[0, 1, 2], [3]]
[[0, 1], [2, 3]]
[[0, 1], [2], [3]]
[[0], [1, 2, 3]]
[[0], [1, 2], [3]]
[[0], [1], [2, 3]]
[[0], [1], [2], [3]]

Return generator of newly created lists.

This Page