ValueSet

class dsviper.ValueSet

Bases: object

A class used to represent a value of type set<element_type>. Seamless with a Python seq[object].

Or use Value.create(type_set [, initial_value]).

add(value: _InputValues) None

Add an element to a set. This has no effect if the element is already present.

at(index: int, *, encoded: bool = True) _OutputValues

Return the element at index.

static cast(value: Value) ValueSet

Return a set or raise.

clear() None

Remove all elements from this set.

copy() ValueSet

Return a deep copy.

description(*, namespace: NameSpace | None = None) str

Return the description.

difference(value: Sequence | ValueSet) ValueSet

Return the difference of two or more sets as a new set. (i.e., all elements that are in this set but not the others.)

difference_update(value: Sequence | ValueSet) None

Remove all elements of another set from this set.

discard(value: _InputValues) None

Remove an element from a set; it must be a member. If the element is not a member, do nothing.

empty() bool

Remove True if the container is empty.

extend(elements: Sequence | ValueSet) None

Add the elements of value.

hash() int

Return the hash value.

index(value: _InputValues) int | None

Return the index or None.

intersection(value: Sequence | ValueSet) ValueSet

Return the intersection of two sets as a new set. (i.e., all elements that are in both sets.)

intersection_update(value: Sequence | ValueSet) None

Update a set with the intersection of itself and another.

isdisjoint(value: Sequence | ValueSet) bool

Return True if two sets have a null intersection.

issubset(value: Sequence | ValueSet) bool

Report whether another set contains this set.

issuperset(value: Sequence | ValueSet) bool

Report whether this set contains another set.

max(*, encoded: bool = True) _OutputValues

Return the maximum element or raise.

min(*, encoded: bool = True) _OutputValues

Return the minimum element or raise.

pop(*, encoded: bool = True) _OutputValues

Remove and return the min element. Raises error if the set is empty.

pop_max(*, encoded: bool = True) _OutputValues

Remove and return the max element. Raises error if the set is empty.

remove(value: _InputValues) None

Remove an element from a set; it must be a member. If the element is not a member, raise a KeyError.

representation() str

Return the representation.

size() int

Return the number of elements.

symmetric_difference(value: Sequence | ValueSet) ValueSet

Return the symmetric difference of two sets as a new set. (i.e., all elements that are in exactly one of the sets.)

symmetric_difference_update(value: Sequence | ValueSet) None

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

type() Type

Return the type.

type_code() str

Return the type code.

type_set() TypeSet

Return the type set<element_type>.

union(value: Sequence | ValueSet) ValueSet

Return the union of sets as a new set. (i.e., all elements that are in either set).

update(value: Sequence | ValueSet) None

Update a set with the union of itself and other.