sequencetools.CyclicTuple

Inheritance diagram of abjad.tools.sequencetools.CyclicTuple.CyclicTuple.CyclicTuple

class abjad.tools.sequencetools.CyclicTuple.CyclicTuple.CyclicTuple[source]

New in version 2.0.

Abjad model of cyclic tuple:

abjad> from abjad.tools import sequencetools
abjad> cyclic_tuple = sequencetools.CyclicTuple('abcd')
abjad> cyclic_tuple
CyclicTuple([a, b, c, d])
abjad> for x in range(8):
...     print x, cyclic_tuple[x]
...
0 a
1 b
2 c
3 d
4 a
5 b
6 c
7 d

Cyclic tuples overload the item-getting method of built-in tuples.

Cyclic tuples return a value for any integer index.

Cyclic tuples otherwise behave exactly like built-in tuples.

Methods

CyclicTuple.count(value) → integer -- return number of occurrences of value

Note

Inherited from __builtin__.tuple

CyclicTuple.index(value[, start[, stop]]) → integer -- return first index of value.

Raises ValueError if the value is not present.

Note

Inherited from __builtin__.tuple

Special Methods

CyclicTuple.__add__()

x.__add__(y) <==> x+y

Note

Inherited from __builtin__.tuple

CyclicTuple.__contains__()

x.__contains__(y) <==> y in x

Note

Inherited from __builtin__.tuple

CyclicTuple.__delattr__()

x.__delattr__(‘name’) <==> del x.name

Note

Inherited from __builtin__.object

CyclicTuple.__eq__()

x.__eq__(y) <==> x==y

Note

Inherited from __builtin__.tuple

CyclicTuple.__ge__()

x.__ge__(y) <==> x>=y

Note

Inherited from __builtin__.tuple

CyclicTuple.__getitem__(expr)[source]
CyclicTuple.__getslice__(start_index, stop_index)[source]
CyclicTuple.__gt__()

x.__gt__(y) <==> x>y

Note

Inherited from __builtin__.tuple

CyclicTuple.__hash__() <==> hash(x)

Note

Inherited from __builtin__.tuple

CyclicTuple.__iter__() <==> iter(x)

Note

Inherited from __builtin__.tuple

CyclicTuple.__le__()

x.__le__(y) <==> x<=y

Note

Inherited from __builtin__.tuple

CyclicTuple.__len__() <==> len(x)

Note

Inherited from __builtin__.tuple

CyclicTuple.__lt__()

x.__lt__(y) <==> x<y

Note

Inherited from __builtin__.tuple

CyclicTuple.__mul__()

x.__mul__(n) <==> x*n

Note

Inherited from __builtin__.tuple

CyclicTuple.__ne__()

x.__ne__(y) <==> x!=y

Note

Inherited from __builtin__.tuple

CyclicTuple.__repr__()[source]
CyclicTuple.__rmul__()

x.__rmul__(n) <==> n*x

Note

Inherited from __builtin__.tuple

CyclicTuple.__setattr__()

x.__setattr__(‘name’, value) <==> x.name = value

Note

Inherited from __builtin__.object

CyclicTuple.__str__()[source]

Table Of Contents

This Page