Partition l into list result of sublists according to weights.
Behavior of fill:
Behavior of cyclic:
Behavior of overhang:
Raise PartitionError when
Examples:
abjad> l = [3, 3, 3, 3, 4, 4, 4, 4, 5, 5]
abjad> t = listtools.group_by_weights(l, [3, 9], fill = 'exact', cyclic = False, overhang = False)
[[3], [3, 3, 3]]
abjad> listtools.group_by_weights(l, [3, 9], fill = 'exact', cyclic = False, overhang = True)
[[3], [3, 3, 3], [4, 4, 4, 4, 5, 5]]
abjad> t = listtools.group_by_weights(l, [3, 9], fill = 'exact', cyclic = True, overhang = False)
PartitionError
abjad> listtools.group_by_weights(l, [3, 9], fill = 'exact', cyclic = True, overhang = True)
PartitionError
abjad> listtools.group_by_weights(l, [3, 9], fill = 'less', cyclic = False, overhang = False)
t == [[3], [3, 3, 3]]
abjad> listtools.group_by_weights(l, [3, 9], fill = 'less', cyclic = False, overhang = True)
[[3], [3, 3, 3], [4, 4, 4, 4, 5, 5]]
abjad> listtools.group_by_weights(l, [3, 9], fill = 'less', cyclic = True, overhang = False)
PartitionError
abjad> t = listtools.group_by_weights(l, [3, 9], fill = 'less', cyclic = True, overhang = True)
PartitionError
abjad> listtools.group_by_weights(l, [3, 9], fill = 'greater', cyclic = False, overhang = False)
[[3], [3, 3, 3]]
abjad> listtools.group_by_weights(l, [3, 9], fill = 'greater', cyclic = False, overhang = True)
[[3], [3, 3, 3], [4, 4, 4, 4, 5, 5]]
abjad> listtools.group_by_weights(l, [3, 9], fill = 'greater', cyclic = True, overhang = False)
[[3], [3, 3, 3], [4], [4, 4, 4], [5]]
abjad> listtools.group_by_weights(l, [3, 9], fill = 'greater', cyclic = True, overhang = True)
[[3], [3, 3, 3], [4], [4, 4, 4], [5], [5]]