API Reference / Modules / internal / types / collections / set internal.types.collections.set Standard library Module View source class Set class Set[K] View complete class API → Fields 1 K type Constructors 2 __init__ __init__(self: Self, /) __init__ __init__(self: Self, g: Generator[K], /) Methods 18 resize resize(self: Self, new_n_buckets: int) add add(self: Self, key: K, /) update update(self: Self, other: Generator[K], /) remove remove(self: Self, key: K, /) pop pop(self: Self, /) -> K discard discard(self: Self, key: K, /) difference difference(self: Self, other: Set[K], /) -> Set[K] difference_update difference_update(self: Self, other: Set[K], /) intersection intersection(self: Self, other: Set[K], /) -> Set[K] intersection_update intersection_update(self: Self, other: Set[K], /) symmetric_difference symmetric_difference(self: Self, other: Set[K], /) -> Set[K] symmetric_difference_update symmetric_difference_update(self: Self, other: Set[K], /) union union(self: Self, other: Set[K], /) -> Set[K] isdisjoint isdisjoint(self: Self, other: Set[K], /) -> bool issubset issubset(self: Self, other: Set[K], /) -> bool issuperset issuperset(self: Self, other: Set[K], /) -> bool clear clear(self: Self, /) copy copy(self: Self, /) -> Set[K] Special methods 21 __sub__ __sub__(self: Self, other: Set[K], /) -> Set[K] __isub__ __isub__(self: Self, other: Set[K], /) -> Set[K] __and__ @commutative @associative __and__(self: Self, other: Set[K], /) -> Set[K] __iand__ __iand__(self: Self, other: Set[K], /) -> Set[K] __or__ @commutative @associative __or__(self: Self, other: Set[K], /) -> Set[K] __ior__ __ior__(self: Self, other: Set[K], /) -> Set[K] __xor__ @commutative @associative __xor__(self: Self, other: Set[K], /) -> Set[K] __ixor__ __ixor__(self: Self, other: Set[K], /) -> Set[K] __contains__ __contains__(self: Self, key: K, /) -> bool __eq__ __eq__(self: Self, other: Set[K], /) -> bool __ne__ __ne__(self: Self, other: Set[K], /) -> bool __le__ __le__(self: Self, other: Set[K], /) -> bool __ge__ __ge__(self: Self, other: Set[K], /) -> bool __lt__ __lt__(self: Self, other: Set[K], /) -> bool __gt__ __gt__(self: Self, other: Set[K], /) -> bool __iter__ __iter__(self: Self, /) -> Generator[K] __len__ __len__(self: Self, /) -> int __bool__ __bool__(self: Self) -> bool __copy__ __copy__(self: Self) -> Set[K] __deepcopy__ __deepcopy__(self: Self) -> Set[K] __repr__ __repr__(self: Self, /) -> str alias set set = Set Alias of Set
class Set class Set[K] View complete class API → Fields 1 K type Constructors 2 __init__ __init__(self: Self, /) __init__ __init__(self: Self, g: Generator[K], /) Methods 18 resize resize(self: Self, new_n_buckets: int) add add(self: Self, key: K, /) update update(self: Self, other: Generator[K], /) remove remove(self: Self, key: K, /) pop pop(self: Self, /) -> K discard discard(self: Self, key: K, /) difference difference(self: Self, other: Set[K], /) -> Set[K] difference_update difference_update(self: Self, other: Set[K], /) intersection intersection(self: Self, other: Set[K], /) -> Set[K] intersection_update intersection_update(self: Self, other: Set[K], /) symmetric_difference symmetric_difference(self: Self, other: Set[K], /) -> Set[K] symmetric_difference_update symmetric_difference_update(self: Self, other: Set[K], /) union union(self: Self, other: Set[K], /) -> Set[K] isdisjoint isdisjoint(self: Self, other: Set[K], /) -> bool issubset issubset(self: Self, other: Set[K], /) -> bool issuperset issuperset(self: Self, other: Set[K], /) -> bool clear clear(self: Self, /) copy copy(self: Self, /) -> Set[K] Special methods 21 __sub__ __sub__(self: Self, other: Set[K], /) -> Set[K] __isub__ __isub__(self: Self, other: Set[K], /) -> Set[K] __and__ @commutative @associative __and__(self: Self, other: Set[K], /) -> Set[K] __iand__ __iand__(self: Self, other: Set[K], /) -> Set[K] __or__ @commutative @associative __or__(self: Self, other: Set[K], /) -> Set[K] __ior__ __ior__(self: Self, other: Set[K], /) -> Set[K] __xor__ @commutative @associative __xor__(self: Self, other: Set[K], /) -> Set[K] __ixor__ __ixor__(self: Self, other: Set[K], /) -> Set[K] __contains__ __contains__(self: Self, key: K, /) -> bool __eq__ __eq__(self: Self, other: Set[K], /) -> bool __ne__ __ne__(self: Self, other: Set[K], /) -> bool __le__ __le__(self: Self, other: Set[K], /) -> bool __ge__ __ge__(self: Self, other: Set[K], /) -> bool __lt__ __lt__(self: Self, other: Set[K], /) -> bool __gt__ __gt__(self: Self, other: Set[K], /) -> bool __iter__ __iter__(self: Self, /) -> Generator[K] __len__ __len__(self: Self, /) -> int __bool__ __bool__(self: Self) -> bool __copy__ __copy__(self: Self) -> Set[K] __deepcopy__ __deepcopy__(self: Self) -> Set[K] __repr__ __repr__(self: Self, /) -> str