abjad.cyclictuple
|
Cyclic tuple. |
- class abjad.cyclictuple.CyclicTuple(items: Sequence = ())[source]
Cyclic tuple.
Cyclic tuples overload the item-getting method of built-in tuples to return a value for any integer index. Cyclic tuples otherwise behave exactly like built-in tuples:
>>> cycle = abjad.CyclicTuple("abcd") >>> for x in range(8): ... print(x, cycle[x]) ... 0 a 1 b 2 c 3 d 4 a 5 b 6 c 7 d