TypedSet#

class TypedSet(iterable=[], types=[])[source]#

A set that enforces all elements have the same type.

Attributes:
types

Methods

add(item)

Add an element to a set.

difference

Return the difference of two or more sets as a new set.

difference_update

Remove all elements of another set from this set.

discard

Remove an element from a set if it is a member.

intersection

Return the intersection of two sets as a new set.

intersection_update

Update a set with the intersection of itself and another.

isdisjoint

Return True if two sets have a null intersection.

issubset

Report whether another set contains this set.

issuperset

Report whether this set contains another set.

symmetric_difference

Return the symmetric difference of two sets as a new set.

symmetric_difference_update

Update a set with the symmetric difference of itself and another.

union

Return the union of sets as a new set.