class documentation

class MutableList(Mutable, list):

View In Hierarchy

A list type that implements .Mutable.

The .MutableList object implements a list that will emit change events to the underlying mapping when the contents of the list are altered, including when values are added or removed.

Note that .MutableList does not apply mutable tracking to the values themselves inside the list. Therefore it is not a sufficient solution for the use case of tracking deep changes to a recursive mutable structure, such as a JSON structure. To support this use case, build a subclass of .MutableList that provides appropriate coercion to the values placed in the dictionary so that they too are "mutable", and emit events up to their parent structure.

New in version 1.1.

See Also

.MutableDict

.MutableSet

Class Method coerce Convert plain list to instance of this class.
Method append Undocumented
Method clear Undocumented
Method extend Undocumented
Method insert Undocumented
Method pop Undocumented
Method remove Undocumented
Method reverse Undocumented
Method sort Undocumented
Method __delitem__ Detect list del events and emit change events.
Method __delslice__ Detect list del events and emit change events.
Method __iadd__ Undocumented
Method __reduce​_ex__ Undocumented
Method __setitem__ Detect list set events and emit change events.
Method __setslice__ Detect list set events and emit change events.
Method __setstate__ Undocumented

Inherited from Mutable:

Class Method as​_mutable Associate a SQL type with this mutable Python type.
Class Method associate​_with Associate this wrapper with all future mapped columns of the given type.
Class Method associate​_with​_attribute Establish this type as a mutation listener for the given mapped descriptor.
Method changed Subclasses should call this method whenever change events occur.

Inherited from MutableBase (via Mutable):

Class Method ​_get​_listen​_keys Given a descriptor attribute, return a set() of the attribute keys which indicate a change in the state of this attribute.
Class Method ​_listen​_on​_attribute Establish this type as a mutation listener for the given mapped descriptor.
Property ​_parents Dictionary of parent object's .InstanceState->attribute name on the parent.
@classmethod
def coerce(cls, index, value):
Convert plain list to instance of this class.
def append(self, x):

Undocumented

def clear(self):

Undocumented

def extend(self, x):

Undocumented

def insert(self, i, x):

Undocumented

def pop(self, *arg):

Undocumented

def remove(self, i):

Undocumented

def reverse(self):

Undocumented

def sort(self, **kw):

Undocumented

def __delitem__(self, index):
Detect list del events and emit change events.
def __delslice__(self, start, end):
Detect list del events and emit change events.
def __iadd__(self, x):

Undocumented

def __reduce_ex__(self, proto):

Undocumented

def __setitem__(self, index, value):
Detect list set events and emit change events.
def __setslice__(self, start, end, value):
Detect list set events and emit change events.
def __setstate__(self, state):

Undocumented