An abstract set.
Each subclass of
Setmust implement two methods: one to check if an object is contained in the set and one to test if two sets are equal.
otheris a member of this set. This function provides the operator overload for
- other :
Object to be tested for membership
otheris a member of this set,
otheris the same set as this set, i.e. both sets are of the same type and contain the same elements. This function provides the operator overload for
- other :
Object to be tested for equality.
Trueif both sets are of the same type and contain the same elements,
A default implementation of the operator overload for
__ne__(self, other)is provided as
Element creation (optional):
Create an element of this set, either from scratch or from an input parameter.
Object from which to create the new element
- elementmember of this set
inpis None, return an arbitrary element. Otherwise, return the element created from
Generator creating name-value pairs of set elements.
Test if all elements in
otherare contained in this set.
otheris a subset of this set.
Return an element from
inpor from scratch.
__init__($self, /, *args, **kwargs)¶
Initialize self. See help(type(self)) for accurate signature.