CallbackList

class echo.CallbackList(callback, *args, **kwargs)[source]

Bases: list, ContainerMixin

A list that calls a callback function when it is modified.

The first argument should be the callback function (which takes no arguments), and subsequent arguments are as for list.

Methods

append(value)

Append object to the end of the list.

clear()

Remove all items from list.

copy(/)

Return a shallow copy of the list.

count(value, /)

Return number of occurrences of value.

extend(iterable)

Extend list by appending elements from the iterable.

index(value[, start, stop])

Return first index of value.

insert(index, value)

Insert object before index.

pop([index])

Remove and return item at index (default last).

remove(value)

Remove first occurrence of value.

reverse()

Reverse IN PLACE.

sort([key, reverse])

Stable sort IN PLACE.

notify_all

Methods Summary

append(value)

Append object to the end of the list.

clear()

Remove all items from list.

copy(/)

Return a shallow copy of the list.

count(value, /)

Return number of occurrences of value.

extend(iterable)

Extend list by appending elements from the iterable.

index(value[, start, stop])

Return first index of value.

insert(index, value)

Insert object before index.

notify_all(*args, **kwargs)

pop([index])

Remove and return item at index (default last).

remove(value)

Remove first occurrence of value.

reverse()

Reverse IN PLACE.

sort([key, reverse])

Stable sort IN PLACE.

Methods Documentation

append(value)[source]

Append object to the end of the list.

clear()[source]

Remove all items from list.

copy(/)

Return a shallow copy of the list.

count(value, /)

Return number of occurrences of value.

extend(iterable)[source]

Extend list by appending elements from the iterable.

index(value, start=0, stop=sys.maxsize, /)

Return first index of value.

Raises ValueError if the value is not present.

insert(index, value)[source]

Insert object before index.

notify_all(*args, **kwargs)[source]
pop(index=-1)[source]

Remove and return item at index (default last).

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

remove(value)[source]

Remove first occurrence of value.

Raises ValueError if the value is not present.

reverse()[source]

Reverse IN PLACE.

sort(key=None, reverse=False)[source]

Stable sort IN PLACE.