ValueVec

class dsviper.ValueVec

Bases: Value

A value of type vec<numeric_type, size>. Seamless with a Python seq[int|real].

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

This constructor builds a new container over the same elements, so only a mutation inside an element shows through.

at(index: int, *, encoded: Literal[True] = True) → _NumericOutputValues

Return the value at index.

encoded=False returns a Value rather than a native object.

index runs from 0 to len - 1; anything else is out of range, a negative one included. value[-1] follows Python’s own indexing.

static cast(value: Value | _OutputValues) → ValueVec

Return value as a vec<element_type, size>, or raise if it is not one.

copy() → ValueVec

Return a deep copy.

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

Return the value written out, then the vec type, as <value>:<type>.

namespace qualifies the type name.

hash() → int

Return the hash value.

representation() → str

Return the value written out: the components between square brackets, comma separated.

set(index: int, value: _NumericInputValues) → None

Set the value at index.

size() → int

Return the number of elements.

to_tuple() → tuple[_NumericOutputValues, ...]

Return a tuple.

type() → Type

Return the Type this value is an instance of.

type_code() → str

Return the code naming this kind of value, such as “int32”, “struct” or “vector”.

type_vec() → TypeVec

Return the type vec<element_type, size>.