abjad.cyclictuple

abjad.cyclictuple.CyclicTuple([items])

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.

>>> tuple_ = abjad.CyclicTuple("abcd")
>>> tuple_
CyclicTuple(items=('a', 'b', 'c', 'd'))
>>> for x in range(8):
...     print(x, tuple_[x])
... 
0 a
1 b
2 c
3 d
4 a
5 b
6 c
7 d