Skip to main content

Set

Standard library class internal.types.collections.set.Set View source
class Set
class Set[K]
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 28
__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
__to_gpu__
__to_gpu__(self: Self, cache: AllocCache)
Added by internal.gpu
__from_gpu__
__from_gpu__(self: Self, other: Set[K])
Added by internal.gpu
__from_gpu_new__
__from_gpu_new__(other: Set[K])
Added by internal.gpu
__pickle__
__pickle__(self: Self, jar: Jar)
Added by pickle
__unpickle__
__unpickle__(jar: Jar) -> Set[K]
Added by pickle
__to_py__
__to_py__(self: Self) -> cobj
__from_py__
__from_py__(s: cobj) -> Set[K]