sequencetools.repeat_sequence_to_length

abjad.tools.sequencetools.repeat_sequence_to_length.repeat_sequence_to_length(sequence, length, start=0)[source]

New in version 1.1.

Repeat sequence to nonnegative integer length:

abjad> from abjad.tools import sequencetools
abjad> sequencetools.repeat_sequence_to_length(range(5), 11)
[0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0]

Repeat sequence to nonnegative integer length from start:

abjad> sequencetools.repeat_sequence_to_length(range(5), 11, start = 2)
[2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2]

Return newly constructed sequence object.

Changed in version 2.0: renamed listtools.repeat_list_to_length() to sequencetools.repeat_sequence_to_length().

This Page