sequencetools.CyclicList

Inheritance diagram of abjad.tools.sequencetools.CyclicList.CyclicList.CyclicList

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

New in version 2.0.

Abjad model of cyclic list:

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

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

Cyclic lists return a value for any integer index.

Cyclic lists otherwise behave exactly like built-in lists.

Methods

CyclicList.append()

L.append(object) – append object to end

Note

Inherited from __builtin__.list

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

Note

Inherited from __builtin__.list

CyclicList.extend()

L.extend(iterable) – extend list by appending elements from the iterable

Note

Inherited from __builtin__.list

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

Raises ValueError if the value is not present.

Note

Inherited from __builtin__.list

CyclicList.insert()

L.insert(index, object) – insert object before index

Note

Inherited from __builtin__.list

CyclicList.pop([index]) → item -- remove and return item at index (default last).

Raises IndexError if list is empty or index is out of range.

Note

Inherited from __builtin__.list

CyclicList.remove()

L.remove(value) – remove first occurrence of value. Raises ValueError if the value is not present.

Note

Inherited from __builtin__.list

CyclicList.reverse()

L.reverse() – reverse IN PLACE

Note

Inherited from __builtin__.list

CyclicList.sort()

L.sort(cmp=None, key=None, reverse=False) – stable sort IN PLACE; cmp(x, y) -> -1, 0, 1

Note

Inherited from __builtin__.list

Special Methods

CyclicList.__add__()

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

Note

Inherited from __builtin__.list

CyclicList.__contains__()

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

Note

Inherited from __builtin__.list

CyclicList.__delattr__()

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

Note

Inherited from __builtin__.object

CyclicList.__delitem__()

x.__delitem__(y) <==> del x[y]

Note

Inherited from __builtin__.list

CyclicList.__delslice__()

x.__delslice__(i, j) <==> del x[i:j]

Use of negative indices is not supported.

Note

Inherited from __builtin__.list

CyclicList.__eq__()

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

Note

Inherited from __builtin__.list

CyclicList.__ge__()

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

Note

Inherited from __builtin__.list

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

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

Note

Inherited from __builtin__.list

CyclicList.__iadd__()

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

Note

Inherited from __builtin__.list

CyclicList.__imul__()

x.__imul__(y) <==> x*=y

Note

Inherited from __builtin__.list

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

Note

Inherited from __builtin__.list

CyclicList.__le__()

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

Note

Inherited from __builtin__.list

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

Note

Inherited from __builtin__.list

CyclicList.__lt__()

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

Note

Inherited from __builtin__.list

CyclicList.__mul__()

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

Note

Inherited from __builtin__.list

CyclicList.__ne__()

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

Note

Inherited from __builtin__.list

CyclicList.__repr__()[source]
CyclicList.__reversed__()

L.__reversed__() – return a reverse iterator over the list

Note

Inherited from __builtin__.list

CyclicList.__rmul__()

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

Note

Inherited from __builtin__.list

CyclicList.__setattr__()

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

Note

Inherited from __builtin__.object

CyclicList.__setitem__()

x.__setitem__(i, y) <==> x[i]=y

Note

Inherited from __builtin__.list

CyclicList.__setslice__()

x.__setslice__(i, j, y) <==> x[i:j]=y

Use of negative indices is not supported.

Note

Inherited from __builtin__.list

CyclicList.__str__()[source]

Table Of Contents

This Page