class documentation

class MutableSet(Mutable, Set[_T]): (source)

View In Hierarchy

A set type that implements :class:`.Mutable`. The :class:`.MutableSet` object implements a set that will emit change events to the underlying mapping when the contents of the set are altered, including when values are added or removed. Note that :class:`.MutableSet` does **not** apply mutable tracking to the *values themselves* inside the set. Therefore it is not a sufficient solution for the use case of tracking deep changes to a *recursive* mutable structure. To support this use case, build a subclass of :class:`.MutableSet` 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. .. versionadded:: 1.1 .. seealso:: :class:`.MutableDict` :class:`.MutableList`

Class Method coerce Convert plain set to instance of this class.
Method __getstate__ Undocumented
Method __iand__ Undocumented
Method __ior__ Undocumented
Method __isub__ Undocumented
Method __ixor__ Undocumented
Method __reduce_ex__ Undocumented
Method __setstate__ Undocumented
Method add Undocumented
Method clear Undocumented
Method difference_update Undocumented
Method discard Undocumented
Method intersection_update Undocumented
Method pop Undocumented
Method remove Undocumented
Method symmetric_difference_update Undocumented
Method update 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 :class:`.InstanceState`->attribute name on the parent.
@classmethod
def coerce(cls, index: str, value: Any) -> Optional[MutableSet[_T]]: (source)

Convert plain set to instance of this class.

def __getstate__(self) -> Set[_T]: (source)

Undocumented

def __iand__(self, other: AbstractSet[object]) -> MutableSet[_T]: (source)

Undocumented

def __ior__(self, other: AbstractSet[_T]) -> MutableSet[_T]: (source)

Undocumented

def __isub__(self, other: AbstractSet[object]) -> MutableSet[_T]: (source)

Undocumented

def __ixor__(self, other: AbstractSet[_T]) -> MutableSet[_T]: (source)

Undocumented

def __reduce_ex__(self, proto: SupportsIndex) -> Tuple[type, Tuple[List[int]]]: (source)

Undocumented

def __setstate__(self, state: Iterable[_T]): (source)

Undocumented

def add(self, elem: _T): (source)

Undocumented

def clear(self): (source)

Undocumented

def difference_update(self, *arg: Iterable[Any]): (source)

Undocumented

def discard(self, elem: _T): (source)

Undocumented

def intersection_update(self, *arg: Iterable[Any]): (source)

Undocumented

def pop(self, *arg: Any) -> _T: (source)

Undocumented

def remove(self, elem: _T): (source)

Undocumented

def symmetric_difference_update(self, *arg: Iterable[_T]): (source)

Undocumented

def update(self, *arg: Iterable[_T]): (source)

Undocumented